Class TaskCompletionPipe
Provides various extension methods for TaskCompletionPipe<T> class.
Inherited Members
Namespace: DotNext.Threading.Tasks
Assembly: DotNext.Threading.dll
Syntax
public static class TaskCompletionPipe
Methods
| Edit this page View SourceConsume<T>(TaskCompletionPipe<Task<T>>)
Gets asynchronous consumer.
Declaration
public static TaskCompletionPipe.Consumer<T> Consume<T>(this TaskCompletionPipe<Task<T>> pipe)
Parameters
Type | Name | Description |
---|---|---|
TaskCompletionPipe<Task<T>> | pipe | The task completion pipe with typed tasks. |
Returns
Type | Description |
---|---|
TaskCompletionPipe.Consumer<T> | The asynchronous consuming collection. |
Type Parameters
Name | Description |
---|---|
T | The type of the elements in the consuming collection. |
Consume<T>(ReadOnlySpan<Task<T>>)
Gets a collection over tasks to be available as they complete.
Declaration
public static TaskCompletionPipe.Consumer<T> Consume<T>(this ReadOnlySpan<Task<T>> tasks)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<Task<T>> | tasks | A collection of tasks. |
Returns
Type | Description |
---|---|
TaskCompletionPipe.Consumer<T> | A collection over task results to be available as they complete. |
Type Parameters
Name | Description |
---|---|
T | The result type of tasks. |
WhenEach<T>(ReadOnlySpan<T>)
Creates a collection over tasks to be available as they complete.
Declaration
public static IAsyncEnumerable<T> WhenEach<T>(ReadOnlySpan<T> tasks) where T : Task
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<T> | tasks | A collection of tasks. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<T> | A collection over tasks to be available as they complete. |
Type Parameters
Name | Description |
---|---|
T | The type of tasks. |