Table of Contents

Class SubscribeAsyncOptions

Namespace
Savvyio.Messaging
Assembly
Savvyio.Core.dll

Configuration options that is related to implementations of the ISubscriber<TRequest> interface.

public class SubscribeAsyncOptions : AsyncOptions, IAsyncOptions, IParameterObject
Inheritance
SubscribeAsyncOptions
Implements
Inherited Members

Examples

This example shows how to configure subscription behavior so a cancelled receive loop surfaces an OperationCanceledException when needed.

using Savvyio.Messaging;

namespace ExampleApp;

public sealed class SubscribeAsyncOptionsExample
{
    public SubscribeAsyncOptions Configure()
    {
        return new SubscribeAsyncOptions { ThrowIfCancellationWasRequested = true };
    }
}

Constructors

SubscribeAsyncOptions()

Initializes a new instance of the SubscribeAsyncOptions class.

public SubscribeAsyncOptions()

Remarks

The following table shows the initial property values for an instance of SubscribeAsyncOptions.

PropertyInitial Value
ThrowIfCancellationWasRequestedfalse

Properties

ThrowIfCancellationWasRequested

Gets or sets a value indicating whether to throw an OperationCanceledException (or derived thereof) if a CancellationToken was requested cancelled.

public bool ThrowIfCancellationWasRequested { get; set; }

Property Value

bool

true to throw an OperationCanceledException if a CancellationToken was requested cancelled; otherwise, false.

See Also