Export (0) Print
Expand All

DataflowBlock.OutputAvailableAsync<TOutput> Method (ISourceBlock<TOutput>, CancellationToken)

.NET Framework 4.5

Provides a Task<TResult> that asynchronously monitors the source for available output.

Namespace:  System.Threading.Tasks.Dataflow
Assembly:  System.Threading.Tasks.Dataflow (in System.Threading.Tasks.Dataflow.dll)

public static Task<bool> OutputAvailableAsync<TOutput>(
	this ISourceBlock<TOutput> source,
	CancellationToken cancellationToken
)

Type Parameters

TOutput

Specifies the type of data contained in the source.

Parameters

source
Type: System.Threading.Tasks.Dataflow.ISourceBlock<TOutput>

The source to monitor.

cancellationToken
Type: System.Threading.CancellationToken

The cancellation token with which to cancel the asynchronous operation.

Return Value

Type: System.Threading.Tasks.Task<Boolean>
A Task<TResult> that informs of whether and when more output is available. If, when the task completes, its Result is true, more output is available in the source (though another consumer of the source may retrieve the data). If it returns false, more output is not and will never be available, due to the source completing prior to output being available. If it returns false, more output is not and will never be available, due to the source completing prior to output being available.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ISourceBlock<TOutput>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

.NET Framework

Supported in: 4.5

Portable Class Library

Supported in: Portable Class Library
Show:
© 2015 Microsoft