Should we allow async code in event listeners callbacks? Like a CommandListener that publishes events to some other service via an await:
class MyListener(AsyncCommandListener): async def started(self, event: CommandStartedEvent) -> None: await apublish(event)
We could also decide that event listener callbacks should never do blocking I/O. Users that want to use async in a callback would need to defer the work to another thread/loop:
class MyListener(CommandListener): def __init__(self): self.async_worker = ... def started(self, event: CommandStartedEvent) -> None: self.async_worker.publish(event)
- is blocked by
-
PYTHON-5495 Client Backpressure
-
- In Progress
-
- is depended on by
-
PYTHON-5695 Clarify `NoWritesPerformed` error label behavior when multiple retries occur
-
- In Code Review
-