Hello!
On Wed, Jul 15, 2015 at 12:00 AM, Ian Shefferman wrote:
> Is there a way of getting an nginx worker to call some API or perform some
> action, using some of the request data, after a response has already been
> sent to a client? Like, say, sending an IP address to another service.
>
> If this isn't possible, is the best option just asynchronously sending the
> data to some task queue during one of the request phases?
>
Yes. Use the ngx.timer.at() API for it. You can take a look at the
lua-resty-logger-socket library for a real-world example:
https://github.com/cloudflare/lua-resty-logger-socket
Regards,
-agentzh