Class AsyncBranch
- Namespace
- Executables
- Assembly
- executables.dll
Factory methods for creating asynchronous conditional executor branches.
public static class AsyncBranch
- Inheritance
-
AsyncBranch
- Inherited Members
Methods
When<T>(Func<bool>, IAsyncExecutable<Unit, T>)
Creates a parameterless asynchronous executor from an asynchronous executable that runs only when the condition is satisfied.
[Pure]
public static IAsyncExecutor<Unit, Optional<T>> When<T>(Func<bool> condition, IAsyncExecutable<Unit, T> executable)
Parameters
conditionFunc<bool>Condition that decides whether execution should proceed.
executableIAsyncExecutable<Unit, T>Asynchronous executable to run when the condition is satisfied.
Returns
- IAsyncExecutor<Unit, Optional<T>>
Asynchronous executor that returns an Optional<T> containing the result when executed.
Type Parameters
T
Exceptions
- ArgumentNullException
conditionorexecutableis null.
When<T>(Func<bool>, IAsyncExecutor<Unit, Optional<T>>)
Creates a parameterless asynchronous executor that runs only when the condition is satisfied and flattens an optional result.
[Pure]
public static IAsyncExecutor<Unit, Optional<T>> When<T>(Func<bool> condition, IAsyncExecutor<Unit, Optional<T>> executor)
Parameters
conditionFunc<bool>Condition that decides whether execution should proceed.
executorIAsyncExecutor<Unit, Optional<T>>Asynchronous executor to run when the condition is satisfied.
Returns
- IAsyncExecutor<Unit, Optional<T>>
Asynchronous executor that returns the inner optional result when executed.
Type Parameters
T
Exceptions
- ArgumentNullException
conditionorexecutoris null.
When<T>(Func<bool>, IAsyncExecutor<Unit, T>)
Creates a parameterless asynchronous executor that runs only when the condition is satisfied.
[Pure]
public static IAsyncExecutor<Unit, Optional<T>> When<T>(Func<bool> condition, IAsyncExecutor<Unit, T> executor)
Parameters
conditionFunc<bool>Condition that decides whether execution should proceed.
executorIAsyncExecutor<Unit, T>Asynchronous executor to run when the condition is satisfied.
Returns
- IAsyncExecutor<Unit, Optional<T>>
Asynchronous executor that returns an Optional<T> containing the result when executed.
Type Parameters
T
Exceptions
- ArgumentNullException
conditionorexecutoris null.
When<T1, T2>(Func<T1, bool>, IAsyncExecutable<T1, T2>)
Creates an asynchronous executor from an asynchronous executable that runs only when the condition is satisfied.
[Pure]
public static IAsyncExecutor<T1, Optional<T2>> When<T1, T2>(Func<T1, bool> condition, IAsyncExecutable<T1, T2> executable)
Parameters
conditionFunc<T1, bool>Condition that decides whether execution should proceed.
executableIAsyncExecutable<T1, T2>Asynchronous executable to run when the condition is satisfied.
Returns
- IAsyncExecutor<T1, Optional<T2>>
Asynchronous executor that returns an Optional<T> containing the result when executed.
Type Parameters
T1T2
Exceptions
- ArgumentNullException
conditionorexecutableis null.
When<T1, T2>(Func<T1, bool>, IAsyncExecutor<T1, Optional<T2>>)
Creates an asynchronous executor that runs only when the condition is satisfied and flattens an optional result.
[Pure]
public static IAsyncExecutor<T1, Optional<T2>> When<T1, T2>(Func<T1, bool> condition, IAsyncExecutor<T1, Optional<T2>> executor)
Parameters
conditionFunc<T1, bool>Condition that decides whether execution should proceed.
executorIAsyncExecutor<T1, Optional<T2>>Asynchronous executor to run when the condition is satisfied.
Returns
- IAsyncExecutor<T1, Optional<T2>>
Asynchronous executor that returns the inner optional result when executed.
Type Parameters
T1T2
Exceptions
- ArgumentNullException
conditionorexecutoris null.
When<T1, T2>(Func<T1, bool>, IAsyncExecutor<T1, T2>)
Creates an asynchronous executor that runs only when the condition is satisfied.
[Pure]
public static IAsyncExecutor<T1, Optional<T2>> When<T1, T2>(Func<T1, bool> condition, IAsyncExecutor<T1, T2> executor)
Parameters
conditionFunc<T1, bool>Condition that decides whether execution should proceed.
executorIAsyncExecutor<T1, T2>Asynchronous executor to run when the condition is satisfied.
Returns
- IAsyncExecutor<T1, Optional<T2>>
Asynchronous executor that returns an Optional<T> containing the result when executed.
Type Parameters
T1T2
Exceptions
- ArgumentNullException
conditionorexecutoris null.