We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The collect class does not allow for awaitable sinks.
collect
Small example:
async def sink_to_something(x): print(x) return await asyncio.sleep(1) source = streamz.Source() collector = source.collect() collector.sink(sink_to_something) for i in range(10): source.emit(i) collector.flush()
Changing def flush in the collect class from:
def flush
@Stream.register_api() class collect(Stream): ... def flush(self, _=None): out = tuple(self.cache) metadata = list(self.metadata_cache) self._emit(out, metadata) ...
To:
@Stream.register_api() class collect(Stream): ... def flush(self, _=None): out = tuple(self.cache) metadata = list(self.metadata_cache) # change self._emit to self.emit (self.emit waits for awaitable results from downstream) self.emit(out, metadata=metadata) ...
Fixed this problem, but I'm not sure if this has any drawbacks.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The
collect
class does not allow for awaitable sinks.Small example:
Changing
def flush
in the collect class from:To:
Fixed this problem, but I'm not sure if this has any drawbacks.
The text was updated successfully, but these errors were encountered: