Table of Contents

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

handleable IAsyncHandleable<Unit, Unit>
handler AsyncAction

Returns

IDisposable

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

handleable IAsyncHandleable<Unit, T>
handler AsyncFunc<T>

Returns

IDisposable

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

handleable IAsyncHandleable<T, Unit>
handler AsyncAction<T>

Returns

IDisposable

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

handleable IAsyncHandleable<T1, T2>
handler AsyncFunc<T1, T2>

Returns

IDisposable

Type Parameters

T1
T2

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

first IAsyncHandleable<T1, T2, THandler>

First handleable.

second IAsyncHandleable<T1, T2, THandler>

Second handleable.

Returns

IAsyncHandleable<T1, T2, THandler>

Composite handleable that registers handlers in both sources.

Type Parameters

T1
T2
THandler

Exceptions

ArgumentNullException

second is null.