Skip to content

publish_message

faststream.cli.main.publish_message async #

publish_message(broker, extra)
Source code in faststream/cli/main.py
async def publish_message(broker: "BrokerUsecase[Any, Any]", extra: "AnyDict") -> Any:
    try:
        async with broker:
            return await broker.publish(**extra)
    except Exception as e:
        typer.echo(f"Error when broker was publishing: {e}")
        sys.exit(1)