Asynchronous event with no arguments. The event handlers are stored as weak references, in order to not prevent the event handler instances to be garbage collected. The event handlers can be executed either parallel or serial. All functions of this class are thread safe.
Constructor | Description |
Full Usage:
WeakAsynchronousEvent()
|
|
Instance member | Description |
Full Usage:
this.InvokeParallel
Parameters:
CancellationToken
Returns: Task
A task that can be awaited for.
|
Invokes all event handlers in parallel.
|
Full Usage:
this.Subscribe
Parameters:
Func<CancellationToken, Task>
-
The event handler.
|
Subscribes the eventHandler to the event.
|
Full Usage:
this.Unsubscribe
Parameters:
Func<CancellationToken, Task>
-
The event handler.
Returns: bool
True if the event was removed; otherwise, false.
|
Unsubscribes the eventHandler from the event.
|