Is it possible to stop the search if the main HTTP connection is closed by the client?
My use case: "a web-site with Nginx+php+elasticsearch, public user does a search and closes the page immediately"
- Nginx connection is closed
- php-fpm is closed (via http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_ignore_client_abort)
- With php function http://php.net/manual/en/function.register-shutdown-function.php I can execute some code just before exiting
- elasticsearch query still continue
I think it's possible with task API, but I am wondering if there is a more elegant way.