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)