plumpy.events module¶
Event and loop related classes and functions
-
class
plumpy.events.
PlumpyEventLoopPolicy
[source]¶ Bases:
asyncio.unix_events._UnixDefaultEventLoopPolicy
Custom event policy that always returns the same event loop that is made reentrant by
nest_asyncio
.-
_loop
: Optional[asyncio.events.AbstractEventLoop] = None¶
-
-
plumpy.events.
get_event_loop
()¶ Return an asyncio event loop.
When called from a coroutine or a callback (e.g. scheduled with call_soon or similar API), this function will always return the running event loop.
If there is no running event loop set, the function will return the result of get_event_loop_policy().get_event_loop() call.