Прочетете на английски Редактиране

Споделяне чрез


DataflowBlock.TryReceive<TOutput> Method

Definition

Attempts to synchronously receive an item from the ISourceBlock<TOutput>.

C#
public static bool TryReceive<TOutput>(this System.Threading.Tasks.Dataflow.IReceivableSourceBlock<TOutput> source, out TOutput item);

Type Parameters

TOutput

Specifies the type of data contained in the source.

Parameters

source
IReceivableSourceBlock<TOutput>

The source from which to receive.

item
TOutput

The item received from the source.

Returns

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

Remarks

This method does not wait until the source has an item to provide.

It will return whether or not an element was available.

Applies to

Продукт Версии
.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