Class AsyncExecutable
- Namespace
- Executables
- Assembly
- executables.dll
Factory methods for creating asynchronous executables.
public static class AsyncExecutable
- Inheritance
-
AsyncExecutable
- Inherited Members
Methods
Accumulate<T1, T2>(AsyncFunc<T1, T2>)
Creates an asynchronous executable that preserves its input and appends a computed value.
[Pure]
public static IAsyncExecutable<T1, (T1, T2)> Accumulate<T1, T2>(AsyncFunc<T1, T2> func)
Parameters
funcAsyncFunc<T1, T2>Asynchronous delegate that computes an additional value from the input.
Returns
- IAsyncExecutable<T1, (T1, T2)>
Asynchronous executable that returns both the original input and the computed value.
Type Parameters
T1T2
Exceptions
- ArgumentNullException
funcis null.
Create(AsyncAction)
Creates an async executable from a parameterless async action.
[Pure]
public static IAsyncExecutable<Unit, Unit> Create(AsyncAction action)
Parameters
actionAsyncActionAsync action used for execution.
Returns
Exceptions
- ArgumentNullException
actionis null.
Create<T>(AsyncAction<T>)
Creates an async executable from an async action.
[Pure]
public static IAsyncExecutable<T, Unit> Create<T>(AsyncAction<T> action)
Parameters
actionAsyncAction<T>Async action used for execution.
Returns
- IAsyncExecutable<T, Unit>
Type Parameters
T
Exceptions
- ArgumentNullException
actionis null.
Create<T>(AsyncFunc<T>)
Creates an async executable from a parameterless async function.
[Pure]
public static IAsyncExecutable<Unit, T> Create<T>(AsyncFunc<T> func)
Parameters
funcAsyncFunc<T>Async function used for execution.
Returns
- IAsyncExecutable<Unit, T>
Type Parameters
T
Exceptions
- ArgumentNullException
funcis null.
Create<T1, T2>(AsyncAction<T1, T2>)
Creates an async executable from an async action with two arguments.
[Pure]
public static IAsyncExecutable<(T1, T2), Unit> Create<T1, T2>(AsyncAction<T1, T2> action)
Parameters
actionAsyncAction<T1, T2>Async action used for execution.
Returns
- IAsyncExecutable<(T1, T2), Unit>
Async executable that accepts a 2-tuple input and returns Unit.
Type Parameters
T1T2
Exceptions
- ArgumentNullException
actionis null.
Create<T1, T2>(AsyncFunc<T1, T2>)
Creates an async executable from an async function.
[Pure]
public static IAsyncExecutable<T1, T2> Create<T1, T2>(AsyncFunc<T1, T2> func)
Parameters
funcAsyncFunc<T1, T2>Async function used for execution.
Returns
- IAsyncExecutable<T1, T2>
Type Parameters
T1T2
Exceptions
- ArgumentNullException
funcis null.
Create<T1, T2, T3>(AsyncAction<T1, T2, T3>)
Creates an async executable from an async action with three arguments.
[Pure]
public static IAsyncExecutable<(T1, T2, T3), Unit> Create<T1, T2, T3>(AsyncAction<T1, T2, T3> action)
Parameters
actionAsyncAction<T1, T2, T3>Async action used for execution.
Returns
- IAsyncExecutable<(T1, T2, T3), Unit>
Async executable that accepts a 3-tuple input and returns Unit.
Type Parameters
T1T2T3
Exceptions
- ArgumentNullException
actionis null.
Create<T1, T2, T3>(AsyncFunc<T1, T2, T3>)
Creates an async executable from an async function with two arguments.
[Pure]
public static IAsyncExecutable<(T1, T2), T3> Create<T1, T2, T3>(AsyncFunc<T1, T2, T3> func)
Parameters
funcAsyncFunc<T1, T2, T3>Async function used for execution.
Returns
- IAsyncExecutable<(T1, T2), T3>
Async executable that accepts a 2-tuple input and returns function result.
Type Parameters
T1T2T3
Exceptions
- ArgumentNullException
funcis null.
Create<T1, T2, T3, T4>(AsyncAction<T1, T2, T3, T4>)
Creates an async executable from an async action with four arguments.
[Pure]
public static IAsyncExecutable<(T1, T2, T3, T4), Unit> Create<T1, T2, T3, T4>(AsyncAction<T1, T2, T3, T4> action)
Parameters
actionAsyncAction<T1, T2, T3, T4>Async action used for execution.
Returns
- IAsyncExecutable<(T1, T2, T3, T4), Unit>
Async executable that accepts a 4-tuple input and returns Unit.
Type Parameters
T1T2T3T4
Exceptions
- ArgumentNullException
actionis null.
Create<T1, T2, T3, T4>(AsyncFunc<T1, T2, T3, T4>)
Creates an async executable from an async function with three arguments.
[Pure]
public static IAsyncExecutable<(T1, T2, T3), T4> Create<T1, T2, T3, T4>(AsyncFunc<T1, T2, T3, T4> func)
Parameters
funcAsyncFunc<T1, T2, T3, T4>Async function used for execution.
Returns
- IAsyncExecutable<(T1, T2, T3), T4>
Async executable that accepts a 3-tuple input and returns function result.
Type Parameters
T1T2T3T4
Exceptions
- ArgumentNullException
funcis null.
Create<T1, T2, T3, T4, T5>(AsyncFunc<T1, T2, T3, T4, T5>)
Creates an async executable from an async function with four arguments.
[Pure]
public static IAsyncExecutable<(T1, T2, T3, T4), T5> Create<T1, T2, T3, T4, T5>(AsyncFunc<T1, T2, T3, T4, T5> func)
Parameters
funcAsyncFunc<T1, T2, T3, T4, T5>Async function used for execution.
Returns
- IAsyncExecutable<(T1, T2, T3, T4), T5>
Async executable that accepts a 4-tuple input and returns function result.
Type Parameters
T1T2T3T4T5
Exceptions
- ArgumentNullException
funcis null.
FlatMap<T1, T2>(AsyncFunc<T1, IAsyncExecutable<T1, T2>>)
Creates a flattened asynchronous executable from an asynchronous delegate that selects the next executable to run.
[Pure]
public static IAsyncExecutable<T1, T2> FlatMap<T1, T2>(AsyncFunc<T1, IAsyncExecutable<T1, T2>> func)
Parameters
funcAsyncFunc<T1, IAsyncExecutable<T1, T2>>Asynchronous delegate that returns the next executable for the provided input.
Returns
- IAsyncExecutable<T1, T2>
Asynchronous executable that executes the returned executable and exposes its result directly.
Type Parameters
T1T2
Exceptions
- ArgumentNullException
funcis null.
FlatMap<T1, T2>(IAsyncExecutable<T1, IAsyncExecutable<T1, T2>>)
Flattens an asynchronous executable that returns another asynchronous executable into a single executable.
[Pure]
public static IAsyncExecutable<T1, T2> FlatMap<T1, T2>(IAsyncExecutable<T1, IAsyncExecutable<T1, T2>> executable)
Parameters
executableIAsyncExecutable<T1, IAsyncExecutable<T1, T2>>Executable that returns the next executable to run for the same input.
Returns
- IAsyncExecutable<T1, T2>
Asynchronous executable that executes the returned executable and exposes its result directly.
Type Parameters
T1T2
Exceptions
- ArgumentNullException
executableis null.
FlatMap<T1, T2>(Func<T1, IAsyncExecutable<T1, T2>>)
Creates a flattened asynchronous executable from a delegate that selects the next executable to run.
[Pure]
public static IAsyncExecutable<T1, T2> FlatMap<T1, T2>(Func<T1, IAsyncExecutable<T1, T2>> func)
Parameters
funcFunc<T1, IAsyncExecutable<T1, T2>>Delegate that returns the next executable for the provided input.
Returns
- IAsyncExecutable<T1, T2>
Asynchronous executable that executes the returned executable and exposes its result directly.
Type Parameters
T1T2
Exceptions
- ArgumentNullException
funcis null.
Fork<T1, T2, T3>(AsyncFunc<T1, T2>, AsyncFunc<T1, T3>)
Creates an asynchronous executable that runs two asynchronous delegates for the same input and returns both results.
[Pure]
public static IAsyncExecutable<T1, (T2, T3)> Fork<T1, T2, T3>(AsyncFunc<T1, T2> first, AsyncFunc<T1, T3> second)
Parameters
firstAsyncFunc<T1, T2>First asynchronous delegate branch.
secondAsyncFunc<T1, T3>Second asynchronous delegate branch.
Returns
- IAsyncExecutable<T1, (T2, T3)>
Asynchronous executable that returns the results of both branches as a tuple.
Type Parameters
T1T2T3
Exceptions
- ArgumentNullException
firstorsecondis null.
Fork<T1, T2, T3>(IAsyncExecutable<T1, T2>, IAsyncExecutable<T1, T3>)
Creates an asynchronous executable that runs two asynchronous executables for the same input and returns both results.
[Pure]
public static IAsyncExecutable<T1, (T2, T3)> Fork<T1, T2, T3>(IAsyncExecutable<T1, T2> first, IAsyncExecutable<T1, T3> second)
Parameters
firstIAsyncExecutable<T1, T2>First executable branch.
secondIAsyncExecutable<T1, T3>Second executable branch.
Returns
- IAsyncExecutable<T1, (T2, T3)>
Asynchronous executable that returns the results of both branches as a tuple.
Type Parameters
T1T2T3
Exceptions
- ArgumentNullException
firstorsecondis null.
Identity()
Returns a parameterless asynchronous executable that returns Unit unchanged.
[Pure]
public static IAsyncExecutable<Unit, Unit> Identity()
Returns
- IAsyncExecutable<Unit, Unit>
Asynchronous identity executable for Unit.
Identity<T>()
Returns an asynchronous executable that returns its input unchanged.
[Pure]
public static IAsyncExecutable<T, T> Identity<T>()
Returns
- IAsyncExecutable<T, T>
Asynchronous identity executable.
Type Parameters
T
Race(params AsyncAction[])
Creates a parameterless executable that completes with the first finished action.
[Pure]
public static IAsyncExecutable<Unit, Unit> Race(params AsyncAction[] actions)
Parameters
actionsAsyncAction[]Actions participating in the race.
Returns
- IAsyncExecutable<Unit, Unit>
Executable representing the race.
Exceptions
- ArgumentNullException
actionsis null.- ArgumentException
actionsis empty.
RaceSuccess(params AsyncAction[])
Creates a parameterless executable that completes with the first successfully finished action.
[Pure]
public static IAsyncExecutable<Unit, Unit> RaceSuccess(params AsyncAction[] actions)
Parameters
actionsAsyncAction[]Actions participating in the success race.
Returns
- IAsyncExecutable<Unit, Unit>
Executable representing the success race.
Exceptions
- ArgumentNullException
actionsis null.- ArgumentException
actionsis empty.
RaceSuccess<T>(params AsyncAction<T>[])
Creates an executable that completes with the first successfully finished action.
[Pure]
public static IAsyncExecutable<T, Unit> RaceSuccess<T>(params AsyncAction<T>[] actions)
Parameters
actionsAsyncAction<T>[]Actions participating in the success race.
Returns
- IAsyncExecutable<T, Unit>
Executable representing the success race.
Type Parameters
T
Exceptions
- ArgumentNullException
actionsis null.- ArgumentException
actionsis empty.
RaceSuccess<T>(params AsyncFunc<T>[])
Creates a parameterless executable that completes with the first successfully finished delegate.
[Pure]
public static IAsyncExecutable<Unit, T> RaceSuccess<T>(params AsyncFunc<T>[] functions)
Parameters
functionsAsyncFunc<T>[]Delegates participating in the success race.
Returns
- IAsyncExecutable<Unit, T>
Executable representing the success race.
Type Parameters
T
Exceptions
- ArgumentNullException
functionsis null.- ArgumentException
functionsis empty.
RaceSuccess<T1, T2>(params AsyncFunc<T1, T2>[])
Creates an executable that completes with the first successfully finished delegate.
[Pure]
public static IAsyncExecutable<T1, T2> RaceSuccess<T1, T2>(params AsyncFunc<T1, T2>[] functions)
Parameters
functionsAsyncFunc<T1, T2>[]Delegates participating in the success race.
Returns
- IAsyncExecutable<T1, T2>
Executable representing the success race.
Type Parameters
T1T2
Exceptions
- ArgumentNullException
functionsis null.- ArgumentException
functionsis empty.
RaceSuccess<T1, T2>(params IAsyncExecutable<T1, T2>[])
Creates an executable that completes with the first successfully finished executable.
[Pure]
public static IAsyncExecutable<T1, T2> RaceSuccess<T1, T2>(params IAsyncExecutable<T1, T2>[] executables)
Parameters
executablesIAsyncExecutable<T1, T2>[]Executables participating in the race.
Returns
- IAsyncExecutable<T1, T2>
Executable representing the success race.
Type Parameters
T1T2
Exceptions
- ArgumentNullException
executablesis null.- ArgumentException
executablesis empty.
Race<T>(params AsyncAction<T>[])
Creates an executable that completes with the first finished action.
[Pure]
public static IAsyncExecutable<T, Unit> Race<T>(params AsyncAction<T>[] actions)
Parameters
actionsAsyncAction<T>[]Actions participating in the race.
Returns
- IAsyncExecutable<T, Unit>
Executable representing the race.
Type Parameters
T
Exceptions
- ArgumentNullException
actionsis null.- ArgumentException
actionsis empty.
Race<T>(params AsyncFunc<T>[])
Creates a parameterless executable that completes with the first finished delegate.
[Pure]
public static IAsyncExecutable<Unit, T> Race<T>(params AsyncFunc<T>[] functions)
Parameters
functionsAsyncFunc<T>[]Delegates participating in the race.
Returns
- IAsyncExecutable<Unit, T>
Executable representing the race.
Type Parameters
T
Exceptions
- ArgumentNullException
functionsis null.- ArgumentException
functionsis empty.
Race<T1, T2>(params AsyncFunc<T1, T2>[])
Creates an executable that completes with the first finished delegate.
[Pure]
public static IAsyncExecutable<T1, T2> Race<T1, T2>(params AsyncFunc<T1, T2>[] functions)
Parameters
functionsAsyncFunc<T1, T2>[]Delegates participating in the race.
Returns
- IAsyncExecutable<T1, T2>
Executable representing the race.
Type Parameters
T1T2
Exceptions
- ArgumentNullException
functionsis null.- ArgumentException
functionsis empty.
Race<T1, T2>(params IAsyncExecutable<T1, T2>[])
Creates an executable that completes with the first finished executable.
[Pure]
public static IAsyncExecutable<T1, T2> Race<T1, T2>(params IAsyncExecutable<T1, T2>[] executables)
Parameters
executablesIAsyncExecutable<T1, T2>[]Executables participating in the race.
Returns
- IAsyncExecutable<T1, T2>
Executable representing the race.
Type Parameters
T1T2
Exceptions
- ArgumentNullException
executablesis null.- ArgumentException
executablesis empty.