Table of Contents

Interface ISubscriptionTransport

Namespace
AnyProtocol.Protocol.Abstraction
Assembly
AnyProtocol.Protocol.Abstraction.dll

Defines the capability to subscribe to envelopes from logical channels.

public interface ISubscriptionTransport : IMessagingProtocol, IAsyncDisposable
Inherited Members

Methods

SubscribeAsync(string, Func<TransportEnvelope, CancellationToken, ValueTask>, SubscriptionOptions?, CancellationToken)

Subscribes a handler to envelopes received from the specified logical channel.

ValueTask<ITransportSubscription> SubscribeAsync(string channel, Func<TransportEnvelope, CancellationToken, ValueTask> handler, SubscriptionOptions? options = null, CancellationToken cancellationToken = default)

Parameters

channel string

The logical message channel.

handler Func<TransportEnvelope, CancellationToken, ValueTask>

The callback invoked for each received message.

options SubscriptionOptions

The options that control the operation.

cancellationToken CancellationToken

The token used to cancel the operation.

Returns

ValueTask<ITransportSubscription>

A task whose result contains the subscription.

Remarks

Durable transports should requeue or leave uncommitted a delivery when the handler throws MessageAdmissionRejectedException.