python-broqer
python-broqer copied to clipboard
Yield and initial state for MapAsync and MapThreaded
MapAsync and MapThread are stateless and the first value emitted is after running the first coroutine/function. By adding an init
argument the operator get's stateful with init
as initial state.
Additionally explore the use of yield
in the coroutine to emit values during the coroutine/function is running.
Instead of yield it's easier to use self.notify()
. For MapThreaded
a threadsafe variant with loop.call_soon
should be implemented.