Open massyah opened 3 years ago
Streamz uses asyncio/coroutines as a way to manage backpressure, i.e., that the emitting process must wait for there to be space in the pipeline to add stuff in. Your model is the opposite, waiting on some async process as a way to put data into the pipeline. We could very well have a source that does what you want, something like
def from_coroutines(Source):
def __init__(self, coroutines):
self.coos = coroutines
async def _run(self):
for coro in as_completed(self.coos):
res = await coro
await self._emit(res)
@massyah , did you have a chance to do something with my suggestion? It would make a nice example for the docs, I think - although you don't really need streamz for this particular linear workflow.
Hi,
I've been following the docs and reading through the tests, and I cannot get streamz working with Asyncio :/
Here's a very minimal example of a stream comprising of two async operation and one sync :
I've tried a lot of combinations using tornado event loop etc. but didn't manage to get anything working. Is this supposed to be possible or is the Asyncio support still behind? Am I missing something obvious?
Thanks for the help