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
channelstringThe logical message channel.
handlerFunc<TransportEnvelope, CancellationToken, ValueTask>The callback invoked for each received message.
optionsSubscriptionOptionsThe options that control the operation.
cancellationTokenCancellationTokenThe 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.