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
executableIAsyncExecutable<T, Unit>Executable that produces the race trigger.
actionsAsyncAction[]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
actionsis null.- ArgumentException
actionsis 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
executableIAsyncExecutable<T1, Unit>Executable that produces the race trigger.
functionsAsyncFunc<T2>[]Delegates competing for the first successful result.
Returns
- IAsyncExecutable<T1, T2>
Executable that returns the first successful result.
Type Parameters
T1T2
Remarks
If only one delegate is provided, it is composed directly without creating a race-success wrapper.
Exceptions
- ArgumentNullException
functionsis null.- ArgumentException
functionsis 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
executableIAsyncExecutable<T1, T2>Executable that produces the shared race input.
actionsAsyncAction<T2>[]Actions competing for the first successful completion.
Returns
- IAsyncExecutable<T1, Unit>
Executable that completes when the first action completes successfully.
Type Parameters
T1T2
Remarks
If only one action is provided, it is composed directly without creating a race-success wrapper.
Exceptions
- ArgumentNullException
actionsis null.- ArgumentException
actionsis 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
executableIAsyncExecutable<T1, T2>Executable that produces the shared race input.
functionsAsyncFunc<T2, T3>[]Delegates competing for the first successful result.
Returns
- IAsyncExecutable<T1, T3>
Executable that returns the first successful result.
Type Parameters
T1T2T3
Remarks
If only one delegate is provided, it is composed directly without creating a race-success wrapper.
Exceptions
- ArgumentNullException
functionsis null.- ArgumentException
functionsis 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
executableIAsyncExecutable<T1, T2>Executable that produces the shared race input.
executablesIAsyncExecutable<T2, T3>[]Executables competing for the first successful result.
Returns
- IAsyncExecutable<T1, T3>
Executable that returns the first successful result.
Type Parameters
T1T2T3
Remarks
If only one executable is provided, it is composed directly without creating a race-success wrapper.
Exceptions
- ArgumentNullException
executablesis null.- ArgumentException
executablesis 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
executableIAsyncExecutable<T, Unit>Executable that produces the race trigger.
actionsAsyncAction[]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
actionsis null.- ArgumentException
actionsis 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
executableIAsyncExecutable<T1, Unit>Executable that produces the race trigger.
functionsAsyncFunc<T2>[]Delegates competing for the first result.
Returns
- IAsyncExecutable<T1, T2>
Executable that returns the first completed result.
Type Parameters
T1T2
Remarks
If only one delegate is provided, it is composed directly without creating a race wrapper.
Exceptions
- ArgumentNullException
functionsis null.- ArgumentException
functionsis 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
executableIAsyncExecutable<T1, T2>Executable that produces the shared race input.
actionsAsyncAction<T2>[]Actions competing for the first completion.
Returns
- IAsyncExecutable<T1, Unit>
Executable that completes when the first action completes.
Type Parameters
T1T2
Remarks
If only one action is provided, it is composed directly without creating a race wrapper.
Exceptions
- ArgumentNullException
actionsis null.- ArgumentException
actionsis 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
executableIAsyncExecutable<T1, T2>Executable that produces the shared race input.
functionsAsyncFunc<T2, T3>[]Delegates competing for the first result.
Returns
- IAsyncExecutable<T1, T3>
Executable that returns the first completed result.
Type Parameters
T1T2T3
Remarks
If only one delegate is provided, it is composed directly without creating a race wrapper.
Exceptions
- ArgumentNullException
functionsis null.- ArgumentException
functionsis 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
executableIAsyncExecutable<T1, T2>Executable that produces the shared race input.
executablesIAsyncExecutable<T2, T3>[]Executables competing for the first result.
Returns
- IAsyncExecutable<T1, T3>
Executable that returns the first completed result.
Type Parameters
T1T2T3
Remarks
If only one executable is provided, it is composed directly without creating a race wrapper.
Exceptions
- ArgumentNullException
executablesis null.- ArgumentException
executablesis empty.