Interface ITransportHandlers
The operations a link written in .NET supplies to stand as a transport.
public interface ITransportHandlers
Remarks
Implement this for a link pamoja does not ship, a vendor SDK, a proprietary radio, or a cloud client, and hand it to FromHandlers(ITransportHandlers). The result composes like any transport: as a ladder rung, under a fault injector, or driven directly. Each method is awaited on a thread pamoja owns, one call at a time per transport; an exception is reported to the caller as a failed operation with the exception's message.
Methods
ConnectAsync()
Establishes the link. Called again on every reconnect.
Task ConnectAsync()
Returns
- Task
A task that completes once the link carries traffic.
SendAsync(string, ReadOnlyMemory<byte>)
Publishes a payload to a topic.
Task SendAsync(string topic, ReadOnlyMemory<byte> payload)
Parameters
topicstringThe destination topic.
payloadReadOnlyMemory<byte>The bytes to send.
Returns
- Task
A task that completes once the link has taken the payload.
SubscribeAsync(string)
Subscribes to a topic filter.
Task SubscribeAsync(string topic)
Parameters
topicstringThe filter, in the syntax the link understands.
Returns
- Task
A task that completes once the subscription is registered.
Remarks
A ladder places its filters again each time the link reconnects.