Help understand the SequentialGeventHandler

32 views
Skip to first unread message

Joshua Downer

unread,
Jul 18, 2014, 4:18:51 PM7/18/14
to pyth...@googlegroups.com
Hi,

I'm looking for a little help in understanding how the async_result is intended to work with the SequentialGeventHandler. I have inherited some code where we were initially using the SequentialThreadingHandler so calling async_result returned a kazoo AsynResult with the handler as an internal variable. However, I think this was causing a problem because we have an async event loop that resulted in a segfault. The documentation in the SequentialThreadingHandler does say that the SequentialGeventHandler should be used when you have an async event loop and switch to the SequentialGeventHandler certainly got rid of the segfault, but now I have some failing unit-tests and I am unsure how to proceed because the documentation on SequentialGeventHandler.async_result says,

"The `AsyncResult` instance will have its completion callbacks executed in the thread the `SequentialGeventHandler` is created in (which should be the gevent/main thread)."

and the method simply returns a default gevent.event.AsynResult instance that has no information from the handler, unlike in the SequentialThreadingHandler.

I'm not sure how a generic AsyncResult is useful. Is this just to ensure that the gevent handler has a consistent interface? Does calling async_result on a SequentialGeventHandler make any sense? Any guidance on this point would be greatly appreciated.

-Josh
Reply all
Reply to author
Forward
0 new messages