Hello!
On Tue, Jun 28, 2016 at 5:46 PM, Robert Paprocki wrote:
> We all know about the perils/joy of sharing data via the module-level
> variables
> (https://github.com/openresty/lua-nginx-module#data-sharing-within-an-nginx-worker).
> And as such, writeable data can be -carefully- shared via this method,
> provided that the light thread doesn't give back control to the scheduler.
> My question is, is there a solid list of APi calls that would give control
> back to the scheduler? The docs for thread.spawn allude to this, but seems
> incomplete. I can think of:
Yeah, this is a good idea to add a "May yield" tag to the API docs for
each API function.
Patches welcome :)
>
> send_headers
> print
> say
These do not yield.
> flush
Only when the true argument is specified.
> req.set_uri
Only when the jump argument is true.
> update_time (maybe?)
This never yields.
The best way to be sure is to search for the "yield" word in the API's
implementation source code :)
Best regards,
-agentzh