[BangPypers] real use case of gevent context switch gevent.sleep(0)

kracekumar ramaraju kracethekingmaker at gmail.com
Sat Jun 20 15:40:06 CEST 2015


Citation from Taskmaster [1], [2].

[1]:
https://github.com/dcramer/taskmaster/blob/79a312c5cb3c34d00829fe9cf4204aeb478a0166/src/taskmaster/client.py#L26
[2]:
https://github.com/dcramer/taskmaster/blob/79a312c5cb3c34d00829fe9cf4204aeb478a0166/src/taskmaster/server.py#L199

The reason to put sleep(0) is to ensure other greenlets gets a chance to
execute.


On Sat, Jun 20, 2015 at 2:41 PM, anu sree <anusree.a04 at gmail.com> wrote:

> Hi,
>
> I have seen an example of gevent context switch
> http://sdiehl.github.io/gevent-tutorial/#synchronous-asynchronous-execution
>
> Could you please give some real use case with example.
> It would be fine If you can share link of github project which uses gevent
> context gevent.sleep(0).
>
> Thanks,
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> https://mail.python.org/mailman/listinfo/bangpypers
>



-- 

*Thanks & Regardskracekumar"Talk is cheap, show me the code" -- Linus
Torvaldshttp://kracekumar.com <http://kracekumar.com>*


More information about the BangPypers mailing list