Table of Contents

Class AsyncConditionalExecutorExtensions

Namespace
Executables
Assembly
executables.dll

Extension methods for building conditional asynchronous executors.

public static class AsyncConditionalExecutorExtensions
Inheritance
AsyncConditionalExecutorExtensions
Inherited Members

Methods

OrElse<T1, T2>(IAsyncExecutor<T1, Optional<T2>>, IAsyncExecutable<T1, T2>)

Supplies an asynchronous fallback executable when the source executor produces no value.

[Pure]
public static IAsyncExecutor<T1, T2> OrElse<T1, T2>(this IAsyncExecutor<T1, Optional<T2>> executor, IAsyncExecutable<T1, T2> fallback)

Parameters

executor IAsyncExecutor<T1, Optional<T2>>

Source optional executor.

fallback IAsyncExecutable<T1, T2>

Fallback asynchronous executable.

Returns

IAsyncExecutor<T1, T2>

Asynchronous executor producing either the original value or the fallback result.

Type Parameters

T1
T2

Exceptions

ArgumentNullException

fallback is null.

OrElse<T1, T2>(IAsyncExecutor<T1, Optional<T2>>, IAsyncExecutor<T1, T2>)

Supplies an asynchronous fallback executor when the source executor produces no value.

[Pure]
public static IAsyncExecutor<T1, T2> OrElse<T1, T2>(this IAsyncExecutor<T1, Optional<T2>> executor, IAsyncExecutor<T1, T2> fallback)

Parameters

executor IAsyncExecutor<T1, Optional<T2>>

Source optional executor.

fallback IAsyncExecutor<T1, T2>

Fallback asynchronous executor.

Returns

IAsyncExecutor<T1, T2>

Asynchronous executor producing either the original value or the fallback result.

Type Parameters

T1
T2

Exceptions

ArgumentNullException

fallback is null.

OrWhen<T>(IAsyncExecutor<Unit, Optional<T>>, Func<bool>, IAsyncExecutable<Unit, T>)

Adds a parameterless asynchronous conditional fallback executed with an asynchronous executable when the source executor produces no value.

[Pure]
public static IAsyncExecutor<Unit, Optional<T>> OrWhen<T>(this IAsyncExecutor<Unit, Optional<T>> executor, Func<bool> condition, IAsyncExecutable<Unit, T> executable)

Parameters

executor IAsyncExecutor<Unit, Optional<T>>

Source optional executor.

condition Func<bool>

Condition evaluated against the original input.

executable IAsyncExecutable<Unit, T>

Asynchronous executable to run when the condition is satisfied.

Returns

IAsyncExecutor<Unit, Optional<T>>

Asynchronous executor producing the original or fallback optional result.

Type Parameters

T

Exceptions

ArgumentNullException

condition or executable is null.

OrWhen<T>(IAsyncExecutor<Unit, Optional<T>>, Func<bool>, IAsyncExecutor<Unit, Optional<T>>)

Adds a parameterless asynchronous conditional fallback executed when the source executor produces no value and flattens an optional fallback result.

[Pure]
public static IAsyncExecutor<Unit, Optional<T>> OrWhen<T>(this IAsyncExecutor<Unit, Optional<T>> executor, Func<bool> condition, IAsyncExecutor<Unit, Optional<T>> other)

Parameters

executor IAsyncExecutor<Unit, Optional<T>>

Source optional executor.

condition Func<bool>

Condition evaluated against the original input.

other IAsyncExecutor<Unit, Optional<T>>

Asynchronous executor to run when the condition is satisfied.

Returns

IAsyncExecutor<Unit, Optional<T>>

Asynchronous executor producing the original or fallback optional result.

Type Parameters

T

Exceptions

ArgumentNullException

condition or other is null.

OrWhen<T>(IAsyncExecutor<Unit, Optional<T>>, Func<bool>, IAsyncExecutor<Unit, T>)

Adds a parameterless asynchronous conditional fallback executed when the source executor produces no value.

[Pure]
public static IAsyncExecutor<Unit, Optional<T>> OrWhen<T>(this IAsyncExecutor<Unit, Optional<T>> executor, Func<bool> condition, IAsyncExecutor<Unit, T> other)

Parameters

executor IAsyncExecutor<Unit, Optional<T>>

Source optional executor.

condition Func<bool>

Condition evaluated against the original input.

other IAsyncExecutor<Unit, T>

Asynchronous executor to run when the condition is satisfied.

Returns

IAsyncExecutor<Unit, Optional<T>>

Asynchronous executor producing the original or fallback optional result.

Type Parameters

T

Exceptions

ArgumentNullException

condition or other is null.

OrWhen<T1, T2>(IAsyncExecutor<T1, Optional<T2>>, Func<T1, bool>, IAsyncExecutable<T1, T2>)

Adds an asynchronous conditional fallback executed with an asynchronous executable when the source executor produces no value.

[Pure]
public static IAsyncExecutor<T1, Optional<T2>> OrWhen<T1, T2>(this IAsyncExecutor<T1, Optional<T2>> executor, Func<T1, bool> condition, IAsyncExecutable<T1, T2> executable)

Parameters

executor IAsyncExecutor<T1, Optional<T2>>

Source optional executor.

condition Func<T1, bool>

Condition evaluated against the original input.

executable IAsyncExecutable<T1, T2>

Asynchronous executable to run when the condition is satisfied.

Returns

IAsyncExecutor<T1, Optional<T2>>

Asynchronous executor producing the original or fallback optional result.

Type Parameters

T1
T2

Exceptions

ArgumentNullException

condition or executable is null.

OrWhen<T1, T2>(IAsyncExecutor<T1, Optional<T2>>, Func<T1, bool>, IAsyncExecutor<T1, Optional<T2>>)

Adds an asynchronous conditional fallback executed when the source executor produces no value and flattens an optional fallback result.

[Pure]
public static IAsyncExecutor<T1, Optional<T2>> OrWhen<T1, T2>(this IAsyncExecutor<T1, Optional<T2>> executor, Func<T1, bool> condition, IAsyncExecutor<T1, Optional<T2>> other)

Parameters

executor IAsyncExecutor<T1, Optional<T2>>

Source optional executor.

condition Func<T1, bool>

Condition evaluated against the original input.

other IAsyncExecutor<T1, Optional<T2>>

Asynchronous executor to run when the condition is satisfied.

Returns

IAsyncExecutor<T1, Optional<T2>>

Asynchronous executor producing the original or fallback optional result.

Type Parameters

T1
T2

Exceptions

ArgumentNullException

condition or other is null.

OrWhen<T1, T2>(IAsyncExecutor<T1, Optional<T2>>, Func<T1, bool>, IAsyncExecutor<T1, T2>)

Adds an asynchronous conditional fallback executed when the source executor produces no value.

[Pure]
public static IAsyncExecutor<T1, Optional<T2>> OrWhen<T1, T2>(this IAsyncExecutor<T1, Optional<T2>> executor, Func<T1, bool> condition, IAsyncExecutor<T1, T2> other)

Parameters

executor IAsyncExecutor<T1, Optional<T2>>

Source optional executor.

condition Func<T1, bool>

Condition evaluated against the original input.

other IAsyncExecutor<T1, T2>

Asynchronous executor to run when the condition is satisfied.

Returns

IAsyncExecutor<T1, Optional<T2>>

Asynchronous executor producing the original or fallback optional result.

Type Parameters

T1
T2

Exceptions

ArgumentNullException

condition or other is null.