Table of Contents

Class RaceExecutableExtensions

Namespace
Executables
Assembly
executables.dll

Extension methods for building race-style executable compositions.

public static class RaceExecutableExtensions
Inheritance
RaceExecutableExtensions
Inherited Members

Methods

RaceSuccess<T>(IAsyncExecutable<T, Unit>, params AsyncAction[])

Races multiple parameterless asynchronous actions after the source executable completes and returns when the first action completes successfully.

[Pure]
public static IAsyncExecutable<T, Unit> RaceSuccess<T>(this IAsyncExecutable<T, Unit> executable, params AsyncAction[] actions)

Parameters

executable IAsyncExecutable<T, Unit>

Executable that produces the race trigger.

actions AsyncAction[]

Actions competing for the first successful completion.

Returns

IAsyncExecutable<T, Unit>

Executable that completes when the first action completes successfully.

Type Parameters

T

Remarks

If only one action is provided, it is composed directly without creating a race-success wrapper.

Exceptions

ArgumentNullException

actions is null.

ArgumentException

actions is empty.

RaceSuccess<T1, T2>(IAsyncExecutable<T1, Unit>, params AsyncFunc<T2>[])

Races multiple parameterless asynchronous delegates after the source executable completes and returns the first successful result.

[Pure]
public static IAsyncExecutable<T1, T2> RaceSuccess<T1, T2>(this IAsyncExecutable<T1, Unit> executable, params AsyncFunc<T2>[] functions)

Parameters

executable IAsyncExecutable<T1, Unit>

Executable that produces the race trigger.

functions AsyncFunc<T2>[]

Delegates competing for the first successful result.

Returns

IAsyncExecutable<T1, T2>

Executable that returns the first successful result.

Type Parameters

T1
T2

Remarks

If only one delegate is provided, it is composed directly without creating a race-success wrapper.

Exceptions

ArgumentNullException

functions is null.

ArgumentException

functions is empty.

RaceSuccess<T1, T2>(IAsyncExecutable<T1, T2>, params AsyncAction<T2>[])

Races multiple asynchronous actions after the source executable completes and returns when the first action completes successfully.

[Pure]
public static IAsyncExecutable<T1, Unit> RaceSuccess<T1, T2>(this IAsyncExecutable<T1, T2> executable, params AsyncAction<T2>[] actions)

Parameters

executable IAsyncExecutable<T1, T2>

Executable that produces the shared race input.

actions AsyncAction<T2>[]

Actions competing for the first successful completion.

Returns

IAsyncExecutable<T1, Unit>

Executable that completes when the first action completes successfully.

Type Parameters

T1
T2

Remarks

If only one action is provided, it is composed directly without creating a race-success wrapper.

Exceptions

ArgumentNullException

actions is null.

ArgumentException

actions is empty.

RaceSuccess<T1, T2, T3>(IAsyncExecutable<T1, T2>, params AsyncFunc<T2, T3>[])

Races multiple asynchronous delegates and returns the first successful result.

[Pure]
public static IAsyncExecutable<T1, T3> RaceSuccess<T1, T2, T3>(this IAsyncExecutable<T1, T2> executable, params AsyncFunc<T2, T3>[] functions)

Parameters

executable IAsyncExecutable<T1, T2>

Executable that produces the shared race input.

functions AsyncFunc<T2, T3>[]

Delegates competing for the first successful result.

Returns

IAsyncExecutable<T1, T3>

Executable that returns the first successful result.

Type Parameters

T1
T2
T3

Remarks

If only one delegate is provided, it is composed directly without creating a race-success wrapper.

Exceptions

ArgumentNullException

functions is null.

ArgumentException

functions is empty.

RaceSuccess<T1, T2, T3>(IAsyncExecutable<T1, T2>, params IAsyncExecutable<T2, T3>[])

Races multiple asynchronous executables and returns the first successful result.

[Pure]
public static IAsyncExecutable<T1, T3> RaceSuccess<T1, T2, T3>(this IAsyncExecutable<T1, T2> executable, params IAsyncExecutable<T2, T3>[] executables)

Parameters

executable IAsyncExecutable<T1, T2>

Executable that produces the shared race input.

executables IAsyncExecutable<T2, T3>[]

Executables competing for the first successful result.

Returns

IAsyncExecutable<T1, T3>

Executable that returns the first successful result.

Type Parameters

T1
T2
T3

Remarks

If only one executable is provided, it is composed directly without creating a race-success wrapper.

Exceptions

ArgumentNullException

executables is null.

ArgumentException

executables is empty.

Race<T>(IAsyncExecutable<T, Unit>, params AsyncAction[])

Races multiple parameterless asynchronous actions after the source executable completes and returns when the first action completes.

[Pure]
public static IAsyncExecutable<T, Unit> Race<T>(this IAsyncExecutable<T, Unit> executable, params AsyncAction[] actions)

Parameters

executable IAsyncExecutable<T, Unit>

Executable that produces the race trigger.

actions AsyncAction[]

Actions competing for the first completion.

Returns

IAsyncExecutable<T, Unit>

Executable that completes when the first action completes.

Type Parameters

T

Remarks

If only one action is provided, it is composed directly without creating a race wrapper.

Exceptions

ArgumentNullException

actions is null.

ArgumentException

actions is empty.

Race<T1, T2>(IAsyncExecutable<T1, Unit>, params AsyncFunc<T2>[])

Races multiple parameterless asynchronous delegates after the source executable completes and returns the first completed result.

[Pure]
public static IAsyncExecutable<T1, T2> Race<T1, T2>(this IAsyncExecutable<T1, Unit> executable, params AsyncFunc<T2>[] functions)

Parameters

executable IAsyncExecutable<T1, Unit>

Executable that produces the race trigger.

functions AsyncFunc<T2>[]

Delegates competing for the first result.

Returns

IAsyncExecutable<T1, T2>

Executable that returns the first completed result.

Type Parameters

T1
T2

Remarks

If only one delegate is provided, it is composed directly without creating a race wrapper.

Exceptions

ArgumentNullException

functions is null.

ArgumentException

functions is empty.

Race<T1, T2>(IAsyncExecutable<T1, T2>, params AsyncAction<T2>[])

Races multiple asynchronous actions after the source executable completes and returns when the first action completes.

[Pure]
public static IAsyncExecutable<T1, Unit> Race<T1, T2>(this IAsyncExecutable<T1, T2> executable, params AsyncAction<T2>[] actions)

Parameters

executable IAsyncExecutable<T1, T2>

Executable that produces the shared race input.

actions AsyncAction<T2>[]

Actions competing for the first completion.

Returns

IAsyncExecutable<T1, Unit>

Executable that completes when the first action completes.

Type Parameters

T1
T2

Remarks

If only one action is provided, it is composed directly without creating a race wrapper.

Exceptions

ArgumentNullException

actions is null.

ArgumentException

actions is empty.

Race<T1, T2, T3>(IAsyncExecutable<T1, T2>, params AsyncFunc<T2, T3>[])

Races multiple asynchronous delegates and returns the first completed result.

[Pure]
public static IAsyncExecutable<T1, T3> Race<T1, T2, T3>(this IAsyncExecutable<T1, T2> executable, params AsyncFunc<T2, T3>[] functions)

Parameters

executable IAsyncExecutable<T1, T2>

Executable that produces the shared race input.

functions AsyncFunc<T2, T3>[]

Delegates competing for the first result.

Returns

IAsyncExecutable<T1, T3>

Executable that returns the first completed result.

Type Parameters

T1
T2
T3

Remarks

If only one delegate is provided, it is composed directly without creating a race wrapper.

Exceptions

ArgumentNullException

functions is null.

ArgumentException

functions is empty.

Race<T1, T2, T3>(IAsyncExecutable<T1, T2>, params IAsyncExecutable<T2, T3>[])

Races multiple asynchronous executables and returns the first completed result.

[Pure]
public static IAsyncExecutable<T1, T3> Race<T1, T2, T3>(this IAsyncExecutable<T1, T2> executable, params IAsyncExecutable<T2, T3>[] executables)

Parameters

executable IAsyncExecutable<T1, T2>

Executable that produces the shared race input.

executables IAsyncExecutable<T2, T3>[]

Executables competing for the first result.

Returns

IAsyncExecutable<T1, T3>

Executable that returns the first completed result.

Type Parameters

T1
T2
T3

Remarks

If only one executable is provided, it is composed directly without creating a race wrapper.

Exceptions

ArgumentNullException

executables is null.

ArgumentException

executables is empty.