C# Class SpicyPixel.Threading.Fiber

A Fiber is a lightweight means of scheduling work that enables multiple units of processing to execute concurrently by co-operatively sharing execution time on a single thread. Fibers are also known as "micro-threads" and can be implemented using programming language facilities such as "coroutines".

Fibers simplify many concurrency issues generally associated with multithreading because a given fiber has complete control over when it yields execution to another fiber. A fiber does not need to manage resource locking or handle changing data in the same way as a thread does because access to a resource is never preempted by another fiber without co-operation.

Fibers can improve performance in certain applications with concurrency requirements. Because many fibers can run on a thread, this can relieve pressure on precious resources in the thread pool and reduce latency. Additionally, some applications have concurrent, interdependent processes that naturally lend themselves to co-operative scheduling which can result in greater efficiency when the application manages the context switch instead of a pre-emptive scheduler.

Fibers can also be a convenient way to express a state machine. The master fiber implementing the machine can test state conditions, start new fibers for state actions, yield to an action fiber until it completes, and then handle the transition out of the state and into a new state.

Show file Open project: spicypixel/concurrency-kit-cs Class Usage Examples

Private Properties

Property Type Description
CancelContinuation void
CheckTimeout int
DelayCoroutine IEnumerator
Execute FiberInstruction
FaultContinuation void
FinishCompletion void
Stop StopInstruction
WhenAllFibersCoroutine IEnumerator
WhenAllTasksCoroutine IEnumerator
WhenAnyFibersCoroutine IEnumerator
WhenAnyTasksCoroutine IEnumerator

Public Methods

Method Description
ContinueWith ( object>.Action continuationAction, object state ) : Fiber

Creates a continuation that executes asynchronously when the target fiber completes.

ContinueWith ( object>.Action continuationAction, object state, CancellationToken cancellationToken ) : Fiber

Creates a continuation that executes asynchronously when the target fiber completes.

ContinueWith ( object>.Action continuationAction, object state, CancellationToken cancellationToken, FiberContinuationOptions continuationOptions, FiberScheduler scheduler ) : Fiber

Creates a continuation that executes asynchronously when the target fiber completes.

ContinueWith ( object>.Action continuationAction, object state, FiberContinuationOptions continuationOptions ) : Fiber

Creates a continuation that executes asynchronously when the target fiber completes.

ContinueWith ( object>.Action continuationAction, object state, FiberScheduler scheduler ) : Fiber

Creates a continuation that executes asynchronously when the target fiber completes.

ContinueWith ( Action continuationAction ) : Fiber

Creates a continuation that executes asynchronously when the target fiber completes.

ContinueWith ( Action continuationAction, CancellationToken cancellationToken ) : Fiber

Creates a continuation that executes asynchronously when the target fiber completes.

ContinueWith ( Action continuationAction, CancellationToken cancellationToken, FiberContinuationOptions continuationOptions, FiberScheduler scheduler ) : Fiber

Creates a continuation that executes asynchronously when the target fiber completes.

ContinueWith ( Action continuationAction, FiberContinuationOptions continuationOptions ) : Fiber

Creates a continuation that executes asynchronously when the target fiber completes.

ContinueWith ( Action continuationAction, FiberScheduler scheduler ) : Fiber

Creates a continuation that executes asynchronously when the target fiber completes.

ContinueWith ( IEnumerator continuationCoroutine ) : Fiber

Creates a continuation that executes asynchronously when the target fiber completes.

ContinueWith ( IEnumerator continuationCoroutine, CancellationToken cancellationToken ) : Fiber

Creates a continuation that executes asynchronously when the target fiber completes.

ContinueWith ( IEnumerator continuationCoroutine, CancellationToken cancellationToken, FiberContinuationOptions continuationOptions, FiberScheduler scheduler ) : Fiber

Creates a continuation that executes asynchronously when the target fiber completes.

ContinueWith ( IEnumerator continuationCoroutine, FiberContinuationOptions continuationOptions ) : Fiber

Creates a continuation that executes asynchronously when the target fiber completes.

ContinueWith ( IEnumerator continuationCoroutine, FiberScheduler scheduler ) : Fiber

Creates a continuation that executes asynchronously when the target fiber completes.

Delay ( System.TimeSpan delay ) : Fiber

Crates a Fiber that waits for a delay before completing.

Delay ( System.TimeSpan delay, CancellationToken cancellationToken ) : Fiber

Crates a Fiber that waits for a delay before completing.

Delay ( int millisecondsDelay ) : Fiber

Crates a Fiber that waits for a delay before completing.

Delay ( int millisecondsDelay, CancellationToken cancellationToken ) : Fiber

Crates a Fiber that waits for a delay before completing.

Delay ( int millisecondsDelay, CancellationToken cancellationToken, FiberScheduler scheduler ) : Fiber

Crates a Fiber that waits for a delay before completing.

Fiber ( System.Action action ) : System

Initializes a new instance of the SpicyPixel.Threading.Fiber class.

Fiber ( System.Action action, CancellationToken cancellationToken ) : System

Initializes a new instance of the SpicyPixel.Threading.Fiber class.

Fiber ( Action action, object state ) : System

Initializes a new instance of the SpicyPixel.Threading.Fiber class.

Fiber ( Action action, object state, CancellationToken cancellationToken ) : System

Initializes a new instance of the SpicyPixel.Threading.Fiber class.

Fiber ( Func func ) : System

Initializes a new instance of the SpicyPixel.Threading.Fiber class.

Fiber ( Func func, CancellationToken cancellationToken ) : System

Initializes a new instance of the SpicyPixel.Threading.Fiber class.

Fiber ( FiberInstruction>.Func func, object state ) : System

Initializes a new instance of the SpicyPixel.Threading.Fiber class.

Fiber ( FiberInstruction>.Func func, object state, CancellationToken cancellationToken ) : System

Initializes a new instance of the SpicyPixel.Threading.Fiber class.

Fiber ( IEnumerator coroutine ) : System

Initializes a new instance of the SpicyPixel.Threading.Fiber class.

Fiber ( IEnumerator coroutine, CancellationToken cancellationToken ) : System

Initializes a new instance of the SpicyPixel.Threading.Fiber class.

Start ( ) : void

Start executing the fiber using the default scheduler on the thread.

Start ( FiberScheduler scheduler ) : void

Start executing the fiber using the specified scheduler.

This method is safe to call from any thread even if different than the scheduler execution thread.

ThrowIfCanceled ( ) : void

Throws if canceled.

ThrowIfCanceledOrFaulted ( ) : void

Throws if canceled or faulted.

ThrowIfFaulted ( ) : void

Throws if faulted.

WhenAll ( ) : Fiber

Returns a fiber that waits on all fibers to complete.

`Fiber.ResultAsObject` will be `true` if all fibers complete successfully or `false` if cancelled or timeout.

WhenAll ( Fiber fibers, CancellationToken cancellationToken ) : Fiber

Returns a fiber that waits on all fibers to complete.

`Fiber.ResultAsObject` will be `true` if all fibers complete successfully or `false` if cancelled or timeout.

WhenAll ( Fiber fibers, System.TimeSpan timeout ) : Fiber

Returns a fiber that waits on all fibers to complete.

`Fiber.ResultAsObject` will be `true` if all fibers complete successfully or `false` if cancelled or timeout.

WhenAll ( Fiber fibers, int millisecondsTimeout ) : Fiber

Returns a fiber that waits on all fibers to complete.

`Fiber.ResultAsObject` will be `true` if all fibers complete successfully or `false` if cancelled or timeout.

WhenAll ( Fiber fibers, int millisecondsTimeout, CancellationToken cancellationToken ) : Fiber

Returns a fiber that waits on all fibers to complete.

`Fiber.ResultAsObject` will be `true` if all fibers complete successfully or `false` if cancelled or timeout.

WhenAll ( Fiber fibers, int millisecondsTimeout, CancellationToken cancellationToken, FiberScheduler scheduler ) : Fiber

Returns a fiber that waits on all fibers to complete.

`Fiber.ResultAsObject` will be `true` if all fibers complete successfully or `false` if cancelled or timeout.

WhenAll ( IEnumerable fibers, int millisecondsTimeout, CancellationToken cancellationToken, FiberScheduler scheduler ) : Fiber

Returns a fiber that waits on all fibers to complete.

`Fiber.ResultAsObject` will be `true` if all fibers complete successfully or `false` if cancelled or timeout.

WhenAll ( IEnumerable tasks, int millisecondsTimeout, CancellationToken cancellationToken, FiberScheduler scheduler ) : Fiber

Returns a fiber that waits on all tasks to complete.

`Fiber.ResultAsObject` will be `true` if all tasks complete successfully or `false` if cancelled or timeout.

WhenAll ( System.Threading.Task tasks, CancellationToken cancellationToken ) : Fiber

Returns a fiber that waits on all tasks to complete.

`Fiber.ResultAsObject` will be `true` if all tasks complete successfully or `false` if cancelled or timeout.

WhenAll ( System.Threading.Task tasks, System.TimeSpan timeout ) : Fiber

Returns a fiber that waits on all tasks to complete.

`Fiber.ResultAsObject` will be `true` if all tasks complete successfully or `false` if cancelled or timeout.

WhenAll ( System.Threading.Task tasks, int millisecondsTimeout ) : Fiber

Returns a fiber that waits on all tasks to complete.

`Fiber.ResultAsObject` will be `true` if all tasks complete successfully or `false` if cancelled or timeout.

WhenAll ( System.Threading.Task tasks, int millisecondsTimeout, CancellationToken cancellationToken ) : Fiber

Returns a fiber that waits on all tasks to complete.

`Fiber.ResultAsObject` will be `true` if all tasks complete successfully or `false` if cancelled or timeout.

WhenAll ( System.Threading.Task tasks, int millisecondsTimeout, CancellationToken cancellationToken, FiberScheduler scheduler ) : Fiber

Returns a fiber that waits on all tasks to complete.

`Fiber.ResultAsObject` will be `true` if all tasks complete successfully or `false` if cancelled or timeout.

WhenAny ( ) : Fiber

Returns a fiber that completes when any fiber finishes.

`Fiber.ResultAsObject` will be the `Fiber` that completed.

WhenAny ( Fiber fibers, CancellationToken cancellationToken ) : Fiber

Returns a fiber that completes when any fiber finishes.

`Fiber.ResultAsObject` will be the `Fiber` that completed.

WhenAny ( Fiber fibers, System.TimeSpan timeout ) : Fiber

Returns a fiber that completes when any fiber finishes.

`Fiber.ResultAsObject` will be the `Fiber` that completed.

WhenAny ( Fiber fibers, int millisecondsTimeout ) : Fiber

Returns a fiber that completes when any fiber finishes.

`Fiber.ResultAsObject` will be the `Fiber` that completed.

WhenAny ( Fiber fibers, int millisecondsTimeout, CancellationToken cancellationToken ) : Fiber

Returns a fiber that completes when any fiber finishes.

`Fiber.ResultAsObject` will be the `Fiber` that completed.

WhenAny ( Fiber fibers, int millisecondsTimeout, CancellationToken cancellationToken, FiberScheduler scheduler ) : Fiber

Returns a fiber that completes when any fiber finishes.

`Fiber.ResultAsObject` will be the `Fiber` that completed.

WhenAny ( IEnumerable fibers, int millisecondsTimeout, CancellationToken cancellationToken, FiberScheduler scheduler ) : Fiber

Returns a fiber that completes when any fiber finishes.

`Fiber.ResultAsObject` will be the `Fiber` that completed.

WhenAny ( IEnumerable tasks, int millisecondsTimeout, CancellationToken cancellationToken, FiberScheduler scheduler ) : Fiber

Returns a fiber that completes when any task finishes.

`Fiber.ResultAsObject` will be the `Task` that completed.

WhenAny ( System.Threading.Task tasks, CancellationToken cancellationToken ) : Fiber

Returns a fiber that completes when any task finishes.

`Fiber.ResultAsObject` will be the `Task` that completed.

WhenAny ( System.Threading.Task tasks, System.TimeSpan timeout ) : Fiber

Returns a fiber that completes when any task finishes.

`Fiber.ResultAsObject` will be the `Task` that completed.

WhenAny ( System.Threading.Task tasks, int millisecondsTimeout ) : Fiber

Returns a fiber that completes when any task finishes.

`Fiber.ResultAsObject` will be the `Task` that completed.

WhenAny ( System.Threading.Task tasks, int millisecondsTimeout, CancellationToken cancellationToken ) : Fiber

Returns a fiber that completes when any task finishes.

`Fiber.ResultAsObject` will be the `Task` that completed.

WhenAny ( System.Threading.Task tasks, int millisecondsTimeout, CancellationToken cancellationToken, FiberScheduler scheduler ) : Fiber

Returns a fiber that completes when any task finishes.

`Fiber.ResultAsObject` will be the `Task` that completed.

Private Methods

Method Description
CancelContinuation ( ) : void

Called by a continuation to cancel the task and trigger other continuations.

CheckTimeout ( System.TimeSpan timeout ) : int
DelayCoroutine ( int millisecondsDelay, CancellationToken cancellationToken ) : IEnumerator
Execute ( ) : FiberInstruction

Executes the fiber until it ends or yields.

FaultContinuation ( Exception exception ) : void

Faults the continuation.

FinishCompletion ( ) : void

Run to finish transitioning to Completed by execution continuations.

Stop ( FiberStatus finalStatus ) : StopInstruction
WhenAllFibersCoroutine ( IEnumerable fibers, int millisecondsTimeout, CancellationToken cancellationToken ) : IEnumerator
WhenAllTasksCoroutine ( IEnumerable tasks, int millisecondsTimeout, CancellationToken cancellationToken ) : IEnumerator
WhenAnyFibersCoroutine ( IEnumerable fibers, int millisecondsTimeout, CancellationToken cancellationToken ) : IEnumerator
WhenAnyTasksCoroutine ( IEnumerable tasks, int millisecondsTimeout, CancellationToken cancellationToken ) : IEnumerator

Method Details

ContinueWith() public method

Creates a continuation that executes asynchronously when the target fiber completes.
public ContinueWith ( object>.Action continuationAction, object state ) : Fiber
continuationAction object>.Action Continuation action.
state object State.
return Fiber

ContinueWith() public method

Creates a continuation that executes asynchronously when the target fiber completes.
public ContinueWith ( object>.Action continuationAction, object state, CancellationToken cancellationToken ) : Fiber
continuationAction object>.Action Continuation action.
state object State.
cancellationToken System.Threading.CancellationToken Cancellation token.
return Fiber

ContinueWith() public method

Creates a continuation that executes asynchronously when the target fiber completes.
public ContinueWith ( object>.Action continuationAction, object state, CancellationToken cancellationToken, FiberContinuationOptions continuationOptions, FiberScheduler scheduler ) : Fiber
continuationAction object>.Action Continuation action.
state object State.
cancellationToken System.Threading.CancellationToken Cancellation token.
continuationOptions FiberContinuationOptions Continuation options.
scheduler FiberScheduler Scheduler.
return Fiber

ContinueWith() public method

Creates a continuation that executes asynchronously when the target fiber completes.
public ContinueWith ( object>.Action continuationAction, object state, FiberContinuationOptions continuationOptions ) : Fiber
continuationAction object>.Action Continuation action.
state object State.
continuationOptions FiberContinuationOptions Continuation options.
return Fiber

ContinueWith() public method

Creates a continuation that executes asynchronously when the target fiber completes.
public ContinueWith ( object>.Action continuationAction, object state, FiberScheduler scheduler ) : Fiber
continuationAction object>.Action Continuation action.
state object State.
scheduler FiberScheduler Scheduler.
return Fiber

ContinueWith() public method

Creates a continuation that executes asynchronously when the target fiber completes.
public ContinueWith ( Action continuationAction ) : Fiber
continuationAction Action Continuation action.
return Fiber

ContinueWith() public method

Creates a continuation that executes asynchronously when the target fiber completes.
public ContinueWith ( Action continuationAction, CancellationToken cancellationToken ) : Fiber
continuationAction Action Continuation action.
cancellationToken System.Threading.CancellationToken Cancellation token.
return Fiber

ContinueWith() public method

Creates a continuation that executes asynchronously when the target fiber completes.
public ContinueWith ( Action continuationAction, CancellationToken cancellationToken, FiberContinuationOptions continuationOptions, FiberScheduler scheduler ) : Fiber
continuationAction Action Continuation action.
cancellationToken System.Threading.CancellationToken Cancellation token.
continuationOptions FiberContinuationOptions Continuation options.
scheduler FiberScheduler Scheduler.
return Fiber

ContinueWith() public method

Creates a continuation that executes asynchronously when the target fiber completes.
public ContinueWith ( Action continuationAction, FiberContinuationOptions continuationOptions ) : Fiber
continuationAction Action Continuation action.
continuationOptions FiberContinuationOptions Continuation options.
return Fiber

ContinueWith() public method

Creates a continuation that executes asynchronously when the target fiber completes.
public ContinueWith ( Action continuationAction, FiberScheduler scheduler ) : Fiber
continuationAction Action Continuation action.
scheduler FiberScheduler Scheduler.
return Fiber

ContinueWith() public method

Creates a continuation that executes asynchronously when the target fiber completes.
public ContinueWith ( IEnumerator continuationCoroutine ) : Fiber
continuationCoroutine IEnumerator Continuation coroutine.
return Fiber

ContinueWith() public method

Creates a continuation that executes asynchronously when the target fiber completes.
public ContinueWith ( IEnumerator continuationCoroutine, CancellationToken cancellationToken ) : Fiber
continuationCoroutine IEnumerator Continuation coroutine.
cancellationToken System.Threading.CancellationToken Cancellation token.
return Fiber

ContinueWith() public method

Creates a continuation that executes asynchronously when the target fiber completes.
public ContinueWith ( IEnumerator continuationCoroutine, CancellationToken cancellationToken, FiberContinuationOptions continuationOptions, FiberScheduler scheduler ) : Fiber
continuationCoroutine IEnumerator Continuation coroutine.
cancellationToken System.Threading.CancellationToken Cancellation token.
continuationOptions FiberContinuationOptions Continuation options.
scheduler FiberScheduler Scheduler.
return Fiber

ContinueWith() public method

Creates a continuation that executes asynchronously when the target fiber completes.
public ContinueWith ( IEnumerator continuationCoroutine, FiberContinuationOptions continuationOptions ) : Fiber
continuationCoroutine IEnumerator Continuation coroutine.
continuationOptions FiberContinuationOptions Continuation options.
return Fiber

ContinueWith() public method

Creates a continuation that executes asynchronously when the target fiber completes.
public ContinueWith ( IEnumerator continuationCoroutine, FiberScheduler scheduler ) : Fiber
continuationCoroutine IEnumerator Continuation coroutine.
scheduler FiberScheduler Scheduler.
return Fiber

Delay() public static method

Crates a Fiber that waits for a delay before completing.
public static Delay ( System.TimeSpan delay ) : Fiber
delay System.TimeSpan Time span to delay.
return Fiber

Delay() public static method

Crates a Fiber that waits for a delay before completing.
public static Delay ( System.TimeSpan delay, CancellationToken cancellationToken ) : Fiber
delay System.TimeSpan Time span to delay.
cancellationToken System.Threading.CancellationToken Cancellation token.
return Fiber

Delay() public static method

Crates a Fiber that waits for a delay before completing.
public static Delay ( int millisecondsDelay ) : Fiber
millisecondsDelay int Milliseconds to delay.
return Fiber

Delay() public static method

Crates a Fiber that waits for a delay before completing.
public static Delay ( int millisecondsDelay, CancellationToken cancellationToken ) : Fiber
millisecondsDelay int Milliseconds to delay.
cancellationToken System.Threading.CancellationToken Cancellation token.
return Fiber

Delay() public static method

Crates a Fiber that waits for a delay before completing.
public static Delay ( int millisecondsDelay, CancellationToken cancellationToken, FiberScheduler scheduler ) : Fiber
millisecondsDelay int Milliseconds to delay.
cancellationToken System.Threading.CancellationToken Cancellation token.
scheduler FiberScheduler Scheduler.
return Fiber

Fiber() public method

Initializes a new instance of the SpicyPixel.Threading.Fiber class.
public Fiber ( System.Action action ) : System
action System.Action /// A non-blocking action to execute on the fiber. ///
return System

Fiber() public method

Initializes a new instance of the SpicyPixel.Threading.Fiber class.
public Fiber ( System.Action action, CancellationToken cancellationToken ) : System
action System.Action /// A non-blocking action to execute on the fiber. ///
cancellationToken System.Threading.CancellationToken Cancellation token.
return System

Fiber() public method

Initializes a new instance of the SpicyPixel.Threading.Fiber class.
public Fiber ( Action action, object state ) : System
action Action /// A non-blocking action to execute on the fiber. ///
state object /// State to pass to the action. ///
return System

Fiber() public method

Initializes a new instance of the SpicyPixel.Threading.Fiber class.
public Fiber ( Action action, object state, CancellationToken cancellationToken ) : System
action Action /// A non-blocking action to execute on the fiber. ///
state object /// State to pass to the action. ///
cancellationToken System.Threading.CancellationToken Cancellation token.
return System

Fiber() public method

Initializes a new instance of the SpicyPixel.Threading.Fiber class.
public Fiber ( Func func ) : System
func Func /// A non-blocking function that returns a when complete. ///
return System

Fiber() public method

Initializes a new instance of the SpicyPixel.Threading.Fiber class.
public Fiber ( Func func, CancellationToken cancellationToken ) : System
func Func /// A non-blocking function that returns a when complete. ///
cancellationToken System.Threading.CancellationToken Cancellation token.
return System

Fiber() public method

Initializes a new instance of the SpicyPixel.Threading.Fiber class.
public Fiber ( FiberInstruction>.Func func, object state ) : System
func FiberInstruction>.Func /// A non-blocking function that returns a when complete. ///
state object /// State to pass to the function. ///
return System

Fiber() public method

Initializes a new instance of the SpicyPixel.Threading.Fiber class.
public Fiber ( FiberInstruction>.Func func, object state, CancellationToken cancellationToken ) : System
func FiberInstruction>.Func /// A non-blocking function that returns a when complete. ///
state object /// State to pass to the function. ///
cancellationToken System.Threading.CancellationToken Cancellation token.
return System

Fiber() public method

Initializes a new instance of the SpicyPixel.Threading.Fiber class.
public Fiber ( IEnumerator coroutine ) : System
coroutine IEnumerator /// A couroutine to execute on the fiber. ///
return System

Fiber() public method

Initializes a new instance of the SpicyPixel.Threading.Fiber class.
public Fiber ( IEnumerator coroutine, CancellationToken cancellationToken ) : System
coroutine IEnumerator /// A couroutine to execute on the fiber. ///
cancellationToken System.Threading.CancellationToken Cancellation token.
return System

Start() public method

Start executing the fiber using the default scheduler on the thread.
public Start ( ) : void
return void

Start() public method

Start executing the fiber using the specified scheduler.
This method is safe to call from any thread even if different than the scheduler execution thread.
public Start ( FiberScheduler scheduler ) : void
scheduler FiberScheduler /// The scheduler to start the fiber on. ///
return void

ThrowIfCanceled() public method

Throws if canceled.
public ThrowIfCanceled ( ) : void
return void

ThrowIfCanceledOrFaulted() public method

Throws if canceled or faulted.
public ThrowIfCanceledOrFaulted ( ) : void
return void

ThrowIfFaulted() public method

Throws if faulted.
public ThrowIfFaulted ( ) : void
return void

WhenAll() public static method

Returns a fiber that waits on all fibers to complete.
`Fiber.ResultAsObject` will be `true` if all fibers complete successfully or `false` if cancelled or timeout.
public static WhenAll ( ) : Fiber
return Fiber

WhenAll() public static method

Returns a fiber that waits on all fibers to complete.
`Fiber.ResultAsObject` will be `true` if all fibers complete successfully or `false` if cancelled or timeout.
public static WhenAll ( Fiber fibers, CancellationToken cancellationToken ) : Fiber
fibers Fiber Fibers to wait for completion.
cancellationToken System.Threading.CancellationToken Cancellation token.
return Fiber

WhenAll() public static method

Returns a fiber that waits on all fibers to complete.
`Fiber.ResultAsObject` will be `true` if all fibers complete successfully or `false` if cancelled or timeout.
public static WhenAll ( Fiber fibers, System.TimeSpan timeout ) : Fiber
fibers Fiber Fibers to wait for completion.
timeout System.TimeSpan Timeout.
return Fiber

WhenAll() public static method

Returns a fiber that waits on all fibers to complete.
`Fiber.ResultAsObject` will be `true` if all fibers complete successfully or `false` if cancelled or timeout.
public static WhenAll ( Fiber fibers, int millisecondsTimeout ) : Fiber
fibers Fiber Fibers to wait for completion.
millisecondsTimeout int Milliseconds timeout.
return Fiber

WhenAll() public static method

Returns a fiber that waits on all fibers to complete.
`Fiber.ResultAsObject` will be `true` if all fibers complete successfully or `false` if cancelled or timeout.
public static WhenAll ( Fiber fibers, int millisecondsTimeout, CancellationToken cancellationToken ) : Fiber
fibers Fiber Fibers to wait for completion.
millisecondsTimeout int Milliseconds timeout.
cancellationToken System.Threading.CancellationToken Cancellation token.
return Fiber

WhenAll() public static method

Returns a fiber that waits on all fibers to complete.
`Fiber.ResultAsObject` will be `true` if all fibers complete successfully or `false` if cancelled or timeout.
public static WhenAll ( Fiber fibers, int millisecondsTimeout, CancellationToken cancellationToken, FiberScheduler scheduler ) : Fiber
fibers Fiber Fibers to wait for completion.
millisecondsTimeout int Milliseconds timeout.
cancellationToken System.Threading.CancellationToken Cancellation token.
scheduler FiberScheduler Scheduler.
return Fiber

WhenAll() public static method

Returns a fiber that waits on all fibers to complete.
`Fiber.ResultAsObject` will be `true` if all fibers complete successfully or `false` if cancelled or timeout.
public static WhenAll ( IEnumerable fibers, int millisecondsTimeout, CancellationToken cancellationToken, FiberScheduler scheduler ) : Fiber
fibers IEnumerable Fibers to wait for completion.
millisecondsTimeout int Milliseconds timeout.
cancellationToken System.Threading.CancellationToken Cancellation token.
scheduler FiberScheduler Scheduler.
return Fiber

WhenAll() public static method

Returns a fiber that waits on all tasks to complete.
`Fiber.ResultAsObject` will be `true` if all tasks complete successfully or `false` if cancelled or timeout.
public static WhenAll ( IEnumerable tasks, int millisecondsTimeout, CancellationToken cancellationToken, FiberScheduler scheduler ) : Fiber
tasks IEnumerable Tasks to wait for completion.
millisecondsTimeout int Milliseconds timeout.
cancellationToken System.Threading.CancellationToken Cancellation token.
scheduler FiberScheduler Scheduler.
return Fiber

WhenAll() public static method

Returns a fiber that waits on all tasks to complete.
`Fiber.ResultAsObject` will be `true` if all tasks complete successfully or `false` if cancelled or timeout.
public static WhenAll ( System.Threading.Task tasks, CancellationToken cancellationToken ) : Fiber
tasks System.Threading.Task Tasks to wait for completion.
cancellationToken System.Threading.CancellationToken Cancellation token.
return Fiber

WhenAll() public static method

Returns a fiber that waits on all tasks to complete.
`Fiber.ResultAsObject` will be `true` if all tasks complete successfully or `false` if cancelled or timeout.
public static WhenAll ( System.Threading.Task tasks, System.TimeSpan timeout ) : Fiber
tasks System.Threading.Task Tasks to wait for completion.
timeout System.TimeSpan Timeout.
return Fiber

WhenAll() public static method

Returns a fiber that waits on all tasks to complete.
`Fiber.ResultAsObject` will be `true` if all tasks complete successfully or `false` if cancelled or timeout.
public static WhenAll ( System.Threading.Task tasks, int millisecondsTimeout ) : Fiber
tasks System.Threading.Task Tasks to wait for completion.
millisecondsTimeout int Milliseconds timeout.
return Fiber

WhenAll() public static method

Returns a fiber that waits on all tasks to complete.
`Fiber.ResultAsObject` will be `true` if all tasks complete successfully or `false` if cancelled or timeout.
public static WhenAll ( System.Threading.Task tasks, int millisecondsTimeout, CancellationToken cancellationToken ) : Fiber
tasks System.Threading.Task Tasks to wait for completion.
millisecondsTimeout int Milliseconds timeout.
cancellationToken System.Threading.CancellationToken Cancellation token.
return Fiber

WhenAll() public static method

Returns a fiber that waits on all tasks to complete.
`Fiber.ResultAsObject` will be `true` if all tasks complete successfully or `false` if cancelled or timeout.
public static WhenAll ( System.Threading.Task tasks, int millisecondsTimeout, CancellationToken cancellationToken, FiberScheduler scheduler ) : Fiber
tasks System.Threading.Task Tasks to wait for completion.
millisecondsTimeout int Milliseconds timeout.
cancellationToken System.Threading.CancellationToken Cancellation token.
scheduler FiberScheduler Scheduler.
return Fiber

WhenAny() public static method

Returns a fiber that completes when any fiber finishes.
`Fiber.ResultAsObject` will be the `Fiber` that completed.
public static WhenAny ( ) : Fiber
return Fiber

WhenAny() public static method

Returns a fiber that completes when any fiber finishes.
`Fiber.ResultAsObject` will be the `Fiber` that completed.
public static WhenAny ( Fiber fibers, CancellationToken cancellationToken ) : Fiber
fibers Fiber Fibers to wait for completion.
cancellationToken System.Threading.CancellationToken Cancellation token.
return Fiber

WhenAny() public static method

Returns a fiber that completes when any fiber finishes.
`Fiber.ResultAsObject` will be the `Fiber` that completed.
public static WhenAny ( Fiber fibers, System.TimeSpan timeout ) : Fiber
fibers Fiber Fibers to wait for completion.
timeout System.TimeSpan Timeout.
return Fiber

WhenAny() public static method

Returns a fiber that completes when any fiber finishes.
`Fiber.ResultAsObject` will be the `Fiber` that completed.
public static WhenAny ( Fiber fibers, int millisecondsTimeout ) : Fiber
fibers Fiber Fibers to wait for completion.
millisecondsTimeout int Milliseconds timeout.
return Fiber

WhenAny() public static method

Returns a fiber that completes when any fiber finishes.
`Fiber.ResultAsObject` will be the `Fiber` that completed.
public static WhenAny ( Fiber fibers, int millisecondsTimeout, CancellationToken cancellationToken ) : Fiber
fibers Fiber Fibers to wait for completion.
millisecondsTimeout int Milliseconds timeout.
cancellationToken System.Threading.CancellationToken Cancellation token.
return Fiber

WhenAny() public static method

Returns a fiber that completes when any fiber finishes.
`Fiber.ResultAsObject` will be the `Fiber` that completed.
public static WhenAny ( Fiber fibers, int millisecondsTimeout, CancellationToken cancellationToken, FiberScheduler scheduler ) : Fiber
fibers Fiber Fibers to wait for completion.
millisecondsTimeout int Milliseconds timeout.
cancellationToken System.Threading.CancellationToken Cancellation token.
scheduler FiberScheduler Scheduler.
return Fiber

WhenAny() public static method

Returns a fiber that completes when any fiber finishes.
`Fiber.ResultAsObject` will be the `Fiber` that completed.
public static WhenAny ( IEnumerable fibers, int millisecondsTimeout, CancellationToken cancellationToken, FiberScheduler scheduler ) : Fiber
fibers IEnumerable Fibers to wait for completion.
millisecondsTimeout int Milliseconds timeout.
cancellationToken System.Threading.CancellationToken Cancellation token.
scheduler FiberScheduler Scheduler.
return Fiber

WhenAny() public static method

Returns a fiber that completes when any task finishes.
`Fiber.ResultAsObject` will be the `Task` that completed.
public static WhenAny ( IEnumerable tasks, int millisecondsTimeout, CancellationToken cancellationToken, FiberScheduler scheduler ) : Fiber
tasks IEnumerable Tasks to wait for completion.
millisecondsTimeout int Milliseconds timeout.
cancellationToken System.Threading.CancellationToken Cancellation token.
scheduler FiberScheduler Scheduler.
return Fiber

WhenAny() public static method

Returns a fiber that completes when any task finishes.
`Fiber.ResultAsObject` will be the `Task` that completed.
public static WhenAny ( System.Threading.Task tasks, CancellationToken cancellationToken ) : Fiber
tasks System.Threading.Task Tasks to wait for completion.
cancellationToken System.Threading.CancellationToken Cancellation token.
return Fiber

WhenAny() public static method

Returns a fiber that completes when any task finishes.
`Fiber.ResultAsObject` will be the `Task` that completed.
public static WhenAny ( System.Threading.Task tasks, System.TimeSpan timeout ) : Fiber
tasks System.Threading.Task Tasks to wait for completion.
timeout System.TimeSpan Timeout.
return Fiber

WhenAny() public static method

Returns a fiber that completes when any task finishes.
`Fiber.ResultAsObject` will be the `Task` that completed.
public static WhenAny ( System.Threading.Task tasks, int millisecondsTimeout ) : Fiber
tasks System.Threading.Task Tasks to wait for completion.
millisecondsTimeout int Milliseconds timeout.
return Fiber

WhenAny() public static method

Returns a fiber that completes when any task finishes.
`Fiber.ResultAsObject` will be the `Task` that completed.
public static WhenAny ( System.Threading.Task tasks, int millisecondsTimeout, CancellationToken cancellationToken ) : Fiber
tasks System.Threading.Task Tasks to wait for completion.
millisecondsTimeout int Milliseconds timeout.
cancellationToken System.Threading.CancellationToken Cancellation token.
return Fiber

WhenAny() public static method

Returns a fiber that completes when any task finishes.
`Fiber.ResultAsObject` will be the `Task` that completed.
public static WhenAny ( System.Threading.Task tasks, int millisecondsTimeout, CancellationToken cancellationToken, FiberScheduler scheduler ) : Fiber
tasks System.Threading.Task Tasks to wait for completion.
millisecondsTimeout int Milliseconds timeout.
cancellationToken System.Threading.CancellationToken Cancellation token.
scheduler FiberScheduler Scheduler.
return Fiber