IReceivableSourceBlock<TOutput>.TryReceive Method

Definition

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

C#
public bool TryReceive(Predicate<TOutput> filter, out TOutput item);
C#
public bool TryReceive(Predicate<TOutput>? filter, out TOutput item);

Parameters

filter
Predicate<TOutput>

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

item
TOutput

The item received from the source.

Returns

true if an item could be received; otherwise, false.

Remarks

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.

Applies to

Proizvod Verzije
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
UWP 10.0