JoinBlock<T1, T2>.TryReceive Method

.NET Framework (current version)

Attempts to synchronously receive an available output item from the IReceivableSourceBlock<TOutput>.

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

public bool TryReceive(
	Predicate<Tuple<T1, T2>> filter,
	out Tuple<T1, T2> item


Type: System.Predicate<Tuple<T1, T2>>

The predicate value must successfully pass in order for it to be received. filter may be null, in which case all items will pass.

Type: System.Tuple<T1, T2>

The item received from the source.

Return Value

Type: System.Boolean
true if an item could be received; otherwise, false.


IReceivableSourceBlock<TOutput>.TryReceive(Predicate<TOutput>, TOutput)

This method does not block waiting for the source to provide an item.

It will return after checking for an element, whether or not an element was available.

.NET Framework

Supported in: 4.5

Portable Class Library

Supported in: Portable Class Library