Table of Contents

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

condition Func<bool>

Condition that decides whether execution should proceed.

executable IAsyncExecutable<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

condition or executable is 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

condition Func<bool>

Condition that decides whether execution should proceed.

executor IAsyncExecutor<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

condition or executor is 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

condition Func<bool>

Condition that decides whether execution should proceed.

executor IAsyncExecutor<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

condition or executor is 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

condition Func<T1, bool>

Condition that decides whether execution should proceed.

executable IAsyncExecutable<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

T1
T2

Exceptions

ArgumentNullException

condition or executable is 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

condition Func<T1, bool>

Condition that decides whether execution should proceed.

executor IAsyncExecutor<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

T1
T2

Exceptions

ArgumentNullException

condition or executor is 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

condition Func<T1, bool>

Condition that decides whether execution should proceed.

executor IAsyncExecutor<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

T1
T2

Exceptions

ArgumentNullException

condition or executor is null.