Class AsyncHandleableExtensions
- Namespace
- Executables.Handling
- Assembly
- executables.dll
Extension methods for asynchronous handleable objects.
public static class AsyncHandleableExtensions
- Inheritance
-
AsyncHandleableExtensions
- Inherited Members
Methods
Handle(IAsyncHandleable<Unit, Unit>, AsyncAction)
Registers a parameterless asynchronous action as a handler.
public static IDisposable Handle(this IAsyncHandleable<Unit, Unit> handleable, AsyncAction handler)
Parameters
handleableIAsyncHandleable<Unit, Unit>handlerAsyncAction
Returns
Handle<T>(IAsyncHandleable<Unit, T>, AsyncFunc<T>)
Registers a parameterless asynchronous function as a handler.
public static IDisposable Handle<T>(this IAsyncHandleable<Unit, T> handleable, AsyncFunc<T> handler)
Parameters
handleableIAsyncHandleable<Unit, T>handlerAsyncFunc<T>
Returns
Type Parameters
T
Handle<T>(IAsyncHandleable<T, Unit>, AsyncAction<T>)
Registers an asynchronous action as a handler.
public static IDisposable Handle<T>(this IAsyncHandleable<T, Unit> handleable, AsyncAction<T> handler)
Parameters
handleableIAsyncHandleable<T, Unit>handlerAsyncAction<T>
Returns
Type Parameters
T
Handle<T1, T2>(IAsyncHandleable<T1, T2>, AsyncFunc<T1, T2>)
Registers an asynchronous function as a handler.
public static IDisposable Handle<T1, T2>(this IAsyncHandleable<T1, T2> handleable, AsyncFunc<T1, T2> handler)
Parameters
handleableIAsyncHandleable<T1, T2>handlerAsyncFunc<T1, T2>
Returns
Type Parameters
T1T2
Merge<T1, T2, THandler>(IAsyncHandleable<T1, T2, THandler>, IAsyncHandleable<T1, T2, THandler>)
Merges two asynchronous handleables into one registration target.
[Pure]
public static IAsyncHandleable<T1, T2, THandler> Merge<T1, T2, THandler>(this IAsyncHandleable<T1, T2, THandler> first, IAsyncHandleable<T1, T2, THandler> second) where THandler : AsyncHandler<T1, T2>
Parameters
firstIAsyncHandleable<T1, T2, THandler>First handleable.
secondIAsyncHandleable<T1, T2, THandler>Second handleable.
Returns
- IAsyncHandleable<T1, T2, THandler>
Composite handleable that registers handlers in both sources.
Type Parameters
T1T2THandler
Exceptions
- ArgumentNullException
secondis null.