Class LoopbackTransport
One in-process link to a broker.
public sealed class LoopbackTransport : IDisposable
- Inheritance
-
LoopbackTransport
- Implements
- Inherited Members
Methods
ConnectAsync()
Marks this link connected so it will carry traffic.
public Task ConnectAsync()
Returns
Exceptions
- PamojaException
The native call failed.
DisconnectAsync()
Marks this link disconnected, so sends over it fail.
public Task DisconnectAsync()
Returns
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
IsConnectedAsync()
Reports whether this link is connected.
public Task<bool> IsConnectedAsync()
Returns
ReceiveAsync()
Waits for the next message on a subscribed topic.
public Task<TransportMessage?> ReceiveAsync()
Returns
- Task<TransportMessage>
The message, or
nullonce the link is closed.
Exceptions
- PamojaException
The native call failed.
SendAsync(string, ReadOnlyMemory<byte>)
Publishes a payload to a topic on the broker.
public Task SendAsync(string topic, ReadOnlyMemory<byte> payload)
Parameters
topicstringThe destination topic.
payloadReadOnlyMemory<byte>The bytes to publish.
Returns
Exceptions
- PamojaException
The link is not connected.
SubscribeAsync(string)
Subscribes this link to a topic.
public Task SubscribeAsync(string topic)
Parameters
topicstringThe topic to subscribe to.
Returns
Exceptions
- PamojaException
The native call failed.