Table of Contents

Class AsyncEventArgs

Namespace
RabbitMQ.Client.Events
Assembly
RabbitMQ.Client.dll

Provides data for AsyncEventHandler<TEvent> events that can be invoked asynchronously.

public class AsyncEventArgs
Inheritance
AsyncEventArgs
Derived
Inherited Members

Constructors

AsyncEventArgs(CancellationToken)

Initializes a new instance of the AsyncEventArgs class.

public AsyncEventArgs(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A cancellation token related to the original operation that raised the event. It's important for your handler to pass this token along to any asynchronous or long-running synchronous operations that take a token so cancellation will correctly propagate. The default value is None.

Fields

Empty

Provides a value to use with events that do not have event data.

public static readonly AsyncEventArgs Empty

Field Value

AsyncEventArgs

Properties

CancellationToken

Gets a cancellation token related to the original operation that raised the event. It's important for your handler to pass this token along to any asynchronous or long-running synchronous operations that take a token so cancellation (via something like

new CancellationTokenSource(TimeSpan.FromSeconds(10)).Token

for example) will correctly propagate.

public CancellationToken CancellationToken { get; }

Property Value

CancellationToken

Methods

CreateOrDefault(CancellationToken)

public static AsyncEventArgs CreateOrDefault(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

AsyncEventArgs