Closed jfhbrook closed 5 years ago
This rearchitects pyee to use a BaseEventEmitter base class that's fully synchronous, and adds the following subclasses for async use:
BaseEventEmitter
AsyncIOEventEmitter
TwistedEventEmitter
ExecutorEventEmtiter
concurrent.futures
futures
It additionally reimplements EventEmitter on top of BaseEventEmitter with a deprecation warning.
EventEmitter
One thing this doesn't solve for is interop between different types of event emitters, but I plan on punting on this until some later date.
This rearchitects pyee to use a
BaseEventEmitter
base class that's fully synchronous, and adds the following subclasses for async use:AsyncIOEventEmitter
- For asyncio coroutines. Similar to EventEmitter but doesn't work with Twisted.TwistedEventEmitter
- For twisted coroutines and inlineCallbacks-decorated functions.ExecutorEventEmtiter
- For threaded use withconcurrent.futures
or thefutures
polyfill.It additionally reimplements
EventEmitter
on top ofBaseEventEmitter
with a deprecation warning.One thing this doesn't solve for is interop between different types of event emitters, but I plan on punting on this until some later date.