On 11/25/14 12:26 AM,
parun...@gmail.com wrote:
> Hello, could someone please enlighten me on gevent/greenlet context
> locals? Particularly:
>
> 1) Is it correct that all variables declared and used e.g. in my
> gevent.wsgi apps should be managed with a local context manager (like
> the one provided by Werkzeug)?
Per my understanding, once you are in the request handler ie the
app(env, start_response) function you are already operating in a
greenlet local context and should not need to do anything.
> 2) What happens if I don't?
Could you possibly give an example of what you want to do? That might
help clarify the consequences of not using a context.
> 3) Why are references to arguments passed to the greenlet function
> preserved in greenlet contexts correctly without such measures (if
> they indeed are)?
I think an example would be very useful here. If you are in an
application handler, then all you get is the response function and the
environment. The handler itself is spawned as a greenlet which has its
local context setup appropriately.
>
> I've read several articles on this topic, but I still feel confused
> and ignorant.
> --
> You received this message because you are subscribed to the Google
> Groups "gevent: coroutine-based Python network library" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
gevent+un...@googlegroups.com
> <mailto:
gevent+un...@googlegroups.com>.
> For more options, visit
https://groups.google.com/d/optout.
HTH
AM