AsynchronousEvent Type

Asynchronous event with no arguments. The event handlers can be executed either parallel or serial. All methods of this class are thread safe.

Constructors

Constructor Description

AsynchronousEvent()

Full Usage: AsynchronousEvent()

Instance members

Instance member Description

this.InvokeParallel

Full Usage: this.InvokeParallel

Parameters:
Returns: Task A task that can be awaited for.

Invokes all event handlers in parallel.

token : CancellationToken
Returns: Task

A task that can be awaited for.

this.Subscribe

Full Usage: this.Subscribe

Parameters:

Subscribes the eventHandler to the event.

eventHandler : Func<CancellationToken, Task>

The event handler.

this.Unsubscribe

Full Usage: this.Unsubscribe

Parameters:
Returns: bool True if the event was removed; otherwise, false.

Unsubscribes the eventHandler from the event.

eventHandler : Func<CancellationToken, Task>

The event handler.

Returns: bool

True if the event was removed; otherwise, false.