GdlrCommandTransportAdapter¶
Base class for command transports.
Description¶
A transport adapter sends command envelopes to a remote target, for example an HTTP or WebSocket server. Override _enable() and _send(). A CapGdlrCommandTransport service selects the adapter for the CapGdlrCommandBus.CommandRoute.target of a command.
Tutorials¶
Properties¶
Methods¶
send(envelope: CapGdlrCommandBus.CommandEnvelope) |
|
void |
enable() |
_send(envelope: CapGdlrCommandBus.CommandEnvelope) abstract |
|
void |
_enable() abstract |
Signals¶
transport_enabled() 🔗
Emitted after enable() completes.
Property Descriptions¶
True after enable() completes. send() waits while this is false.
Method Descriptions¶
CapGdlrCommandBus.CommandResult send(envelope: CapGdlrCommandBus.CommandEnvelope) 🔗
Sends envelope through the transport and returns its result. The method waits for transport_enabled when the transport is not enabled yet. When the route configuration of the envelope has a retry_after_extractor callable, the method applies it to the result. See CapGdlrCommandBus.CommandResult.apply_payload_retry_after_extractor().
void enable() 🔗
Runs _enable(), sets enabled, and emits transport_enabled.
CapGdlrCommandBus.CommandResult _send(envelope: CapGdlrCommandBus.CommandEnvelope) abstract 🔗
Sends envelope to the remote target and returns its result. The method can await.
void _enable() abstract 🔗
Prepares the transport, for example opens a connection. The method can await.