Table of Contents

Class LoopbackTransport

Namespace
Pamoja.Loopback
Assembly
Pamoja.Loopback.dll

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

Task

Exceptions

PamojaException

The native call failed.

DisconnectAsync()

Marks this link disconnected, so sends over it fail.

public Task DisconnectAsync()

Returns

Task

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

Task<bool>

true when connected.

ReceiveAsync()

Waits for the next message on a subscribed topic.

public Task<TransportMessage?> ReceiveAsync()

Returns

Task<TransportMessage>

The message, or null once 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

topic string

The destination topic.

payload ReadOnlyMemory<byte>

The bytes to publish.

Returns

Task

Exceptions

PamojaException

The link is not connected.

SubscribeAsync(string)

Subscribes this link to a topic.

public Task SubscribeAsync(string topic)

Parameters

topic string

The topic to subscribe to.

Returns

Task

Exceptions

PamojaException

The native call failed.