Command Sender¶
Outbound port for asynchronously sending commands.
This module defines a CommandSender, an application-layer abstraction for
dispatching commands via an external message bus. It decouples command
issuance from transport details and message broker implementations.
Responsibilities:
- Forward commands to an injected MessageBus.
- Abstract message dispatch mechanism.
Non-Responsibilities:
- Delivery guarantees (at-least-once, ordering, retries).
- Serialization or transport concerns.
command_sender
¶
Outbound port for asynchronously sending commands.
This module defines a CommandSender, an application-layer abstraction for
dispatching commands via an external message bus. It decouples command
issuance from transport details and message broker implementations.
Responsibilities
- Forward commands to an injected MessageBus.
- Abstract message dispatch mechanism.
Non-Responsibilities
- Delivery guarantees (at-least-once, ordering, retries).
- Serialization or transport concerns.
CommandSender
¶
Bases: OutboundPort[Command, None]
Outbound port for asynchronously sending command messages.
The CommandSender delegates message dispatching to a MessageBus. It is
typically used by use cases or handlers that need to trigger command-side
operations in other parts of the system.
Source code in src/forging_blocks/application/ports/outbound/command_sender.py
send(command: Command) -> None
async
¶
Send a command asynchronously.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
command
|
Command
|
The command instance to dispatch. |
required |
Notes
- This operation is fire-and-forget from the application's
perspective. - Delivery semantics depend on the underlying MessageBus
implementation.