Publisher Direct Usage#
The Publisher Direct Usage is a full-featured way to publish messages. It has AsyncAPI representation and includes testable features. This method creates a reusable Publisher object that can be used directly to publish a message:
It is suitable for publishing different messages to different outputs within the same processing function:
@broker.subscriber("in")
async def handle(msg) -> str:
await publisher1.publish("Response-1")
await publisher2.publish("Response-2")
Last update:
2023-09-21