DotNext by .NET Foundation and Contributors

<PackageReference Include="DotNext" Version="4.15.2" />

 AsyncDelegate

public static class AsyncDelegate
Provides set of methods for asynchronous invocation of various delegates.
public static Task BeginInvoke(this Action<object> action, object state, AsyncCallback callback, TaskCreationOptions options = 0, TaskScheduler scheduler = null)

Invokes synchronous delegate asynchronously.

public static Task BeginInvoke(this Action<object, CancellationToken> action, object state, AsyncCallback callback, TaskCreationOptions options = 0, TaskScheduler scheduler = null, CancellationToken token = default)

Invokes synchronous delegate asynchronously.

public static Task<TResult> BeginInvoke<TResult>(this Func<object, TResult> function, object state, AsyncCallback callback, TaskCreationOptions options = 0, TaskScheduler scheduler = null)

Invokes synchronous delegate asynchronously.

public static Task<TResult> BeginInvoke<TResult>(this Func<object, CancellationToken, TResult> function, object state, AsyncCallback callback, TaskCreationOptions options = 0, TaskScheduler scheduler = null, CancellationToken token = default)

Invokes synchronous delegate asynchronously.

public static Task InvokeAsync<TDelegate>(this TDelegate delegate, Action<TDelegate> invoker, CancellationToken token = default) where TDelegate : MulticastDelegate

Invokes a delegate of arbitrary type asynchronously.

public static Task InvokeAsync<TEventArgs>(this EventHandler<TEventArgs> handler, object sender, TEventArgs args, CancellationToken token = default)

Invokes event handlers asynchronously.

public static Task InvokeAsync(this EventHandler handler, object sender, EventArgs args, CancellationToken token = default)

Invokes event handlers asynchronously.

public static Task InvokeAsync(this Action action, CancellationToken token = default)

Invokes action asynchronously.

public static Task InvokeAsync<T>(this Action<T> action, T arg, CancellationToken token = default)

Invokes action asynchronously.

public static Task InvokeAsync<T1, T2>(this Action<T1, T2> action, T1 arg1, T2 arg2, CancellationToken token = default)

Invokes action asynchronously.

public static Task InvokeAsync<T1, T2, T3>(this Action<T1, T2, T3> action, T1 arg1, T2 arg2, T3 arg3, CancellationToken token = default)

Invokes action asynchronously.

public static Task InvokeAsync<T1, T2, T3, T4>(this Action<T1, T2, T3, T4> action, T1 arg1, T2 arg2, T3 arg3, T4 arg4, CancellationToken token = default)

Invokes action asynchronously.

public static Task InvokeAsync<T1, T2, T3, T4, T5>(this Action<T1, T2, T3, T4, T5> action, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, CancellationToken token = default)

Invokes action asynchronously.

public static Task InvokeAsync<T1, T2, T3, T4, T5, T6>(this Action<T1, T2, T3, T4, T5, T6> action, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, CancellationToken token = default)

Invokes action asynchronously.

public static Task InvokeAsync<T1, T2, T3, T4, T5, T6, T7>(this Action<T1, T2, T3, T4, T5, T6, T7> action, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, CancellationToken token = default)

Invokes action asynchronously.

public static Task InvokeAsync<T1, T2, T3, T4, T5, T6, T7, T8>(this Action<T1, T2, T3, T4, T5, T6, T7, T8> action, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, CancellationToken token = default)

Invokes action asynchronously.

public static Task InvokeAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9>(this Action<T1, T2, T3, T4, T5, T6, T7, T8, T9> action, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, CancellationToken token = default)

Invokes action asynchronously.

public static Task InvokeAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(this Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> action, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, CancellationToken token = default)

Invokes action asynchronously.