Class AsyncEvent<TSender, TArgs>
- Namespace
- DisCatSharp.Common.Utilities
- Assembly
- DisCatSharp.Common.dll
Implementation of asynchronous event. The handlers of such events are executed asynchronously, but sequentially.
public sealed class AsyncEvent<TSender, TArgs> : AsyncEvent where TArgs : AsyncEventArgs
Type Parameters
TSender
Type of the object that dispatches this event.
TArgs
Type of event argument object passed to this event's handlers.
- Inheritance
-
AsyncEvent<TSender, TArgs>
- Inherited Members
- Extension Methods
Remarks
Creates a new asynchronous event with specified name and exception handler.
Constructors
- AsyncEvent(string, TimeSpan, AsyncEventExceptionHandler<TSender, TArgs>?)
Implementation of asynchronous event. The handlers of such events are executed asynchronously, but sequentially.
Properties
- MaximumExecutionTime
Gets the maximum allotted execution time for all handlers. Any event which causes the handler to time out will raise a non-fatal AsyncEventTimeoutException<TSender, TArgs>.
Methods
- InvokeAsync(TSender, TArgs, AsyncEventExceptionMode)
Raises this event by invoking all of its registered handlers, in order of registration.
All exceptions throw during invocation will be handled by the event's registered exception handler.
- Register(AsyncEventHandler<TSender, TArgs>)
Registers a new handler for this event.
- Unregister(AsyncEventHandler<TSender, TArgs>)
Unregisters an existing handler from this event.
- UnregisterAll()
Unregisters all existing handlers from this event.