IReceivableSourceBlock<TOutput> 接口

定义

表示数据流块,其支持在不链接的情况下接收消息。Represents a dataflow block that supports receiving messages without linking.

generic <typename TOutput>
public interface class IReceivableSourceBlock : System::Threading::Tasks::Dataflow::ISourceBlock<TOutput>
public interface IReceivableSourceBlock<TOutput> : System.Threading.Tasks.Dataflow.ISourceBlock<TOutput>
type IReceivableSourceBlock<'Output> = interface
    interface ISourceBlock<'Output>
    interface IDataflowBlock
type IReceivableSourceBlock<'Output> = interface
    interface IDataflowBlock
    interface ISourceBlock<'Output>
Public Interface IReceivableSourceBlock(Of TOutput)
Implements ISourceBlock(Of TOutput)

类型参数

TOutput

指定 IReceivableSourceBlock<TOutput> 提供的数据类型。Specifies the type of data supplied by the IReceivableSourceBlock<TOutput>.

派生
实现

注解

备注

TPL 数据流库(System.Threading.Tasks.Dataflow 命名空间)不随 .NET 一起分发。The TPL Dataflow Library (the System.Threading.Tasks.Dataflow namespace) is not distributed with .NET. 若要在 Visual Studio 中安装 System.Threading.Tasks.Dataflow 命名空间,请打开项目,选择“项目”菜单中的“管理 NuGet 包”,再在线搜索 System.Threading.Tasks.Dataflow 包。To install the System.Threading.Tasks.Dataflow namespace in Visual Studio, open your project, choose Manage NuGet Packages from the Project menu, and search online for the System.Threading.Tasks.Dataflow package. 或者,若要使用 .NET Core CLI 进行安装,请运行 dotnet add package System.Threading.Tasks.DataflowAlternatively, to install it using the .NET Core CLI, run dotnet add package System.Threading.Tasks.Dataflow.

属性

Completion

获取 Task,其表示数据流块的操作和完成。Gets a Task that represents the asynchronous operation and completion of the dataflow block.

(继承自 IDataflowBlock)

方法

Complete()

通知 IDataflowBlock,告知其不应该生成任何更多的消息也不应使用任何更多的延迟消息。Signals to the IDataflowBlock that it should not accept nor produce any more messages nor consume any more postponed messages.

(继承自 IDataflowBlock)
ConsumeMessage(DataflowMessageHeader, ITargetBlock<TOutput>, Boolean)

由链接的 ITargetBlock<TInput> 调用,以接受并使用以前由此 DataflowMessageHeader 提供的 ISourceBlock<TOutput>Called by a linked ITargetBlock<TInput> to accept and consume a DataflowMessageHeader previously offered by this ISourceBlock<TOutput>.

(继承自 ISourceBlock<TOutput>)
Fault(Exception)

导致 IDataflowBlockFaulted 状态下完成。Causes the IDataflowBlock to complete in a Faulted state.

(继承自 IDataflowBlock)
LinkTo(ITargetBlock<TOutput>, DataflowLinkOptions)

ISourceBlock<TOutput> 链接到指定的 ITargetBlock<TInput>Links the ISourceBlock<TOutput> to the specified ITargetBlock<TInput>.

(继承自 ISourceBlock<TOutput>)
ReleaseReservation(DataflowMessageHeader, ITargetBlock<TOutput>)

由链接的 ITargetBlock<TInput> 调用,以发布由此 DataflowMessageHeader 发布的以前已保留的 ISourceBlock<TOutput>Called by a linked ITargetBlock<TInput> to release a previously reserved DataflowMessageHeader by this ISourceBlock<TOutput>.

(继承自 ISourceBlock<TOutput>)
ReserveMessage(DataflowMessageHeader, ITargetBlock<TOutput>)

由链接的 ITargetBlock<TInput> 调用,以保留以前由此 DataflowMessageHeader 提供的 ISourceBlock<TOutput>Called by a linked ITargetBlock<TInput> to reserve a previously offered DataflowMessageHeader by this ISourceBlock<TOutput>.

(继承自 ISourceBlock<TOutput>)
TryReceive(Predicate<TOutput>, TOutput)

IReceivableSourceBlock<TOutput> 中尝试同步接收可用输出项。Attempts to synchronously receive an available output item from the IReceivableSourceBlock<TOutput>.

TryReceiveAll(IList<TOutput>)

IReceivableSourceBlock<TOutput> 中尝试同步接收所有可用项。Attempts to synchronously receive all available items from the IReceivableSourceBlock<TOutput>.

扩展方法

AsObservable<TOutput>(ISourceBlock<TOutput>)

IObservable<T> 创建新的 ISourceBlock<TOutput> 抽象。Creates a new IObservable<T> abstraction over the ISourceBlock<TOutput>.

LinkTo<TOutput>(ISourceBlock<TOutput>, ITargetBlock<TOutput>)

ISourceBlock<TOutput> 链接到指定的 ITargetBlock<TInput>Links the ISourceBlock<TOutput> to the specified ITargetBlock<TInput>.

LinkTo<TOutput>(ISourceBlock<TOutput>, ITargetBlock<TOutput>, Predicate<TOutput>)

用指定的筛选器将 ISourceBlock<TOutput> 链接到指定的 ITargetBlock<TInput>Links the ISourceBlock<TOutput> to the specified ITargetBlock<TInput> using the specified filter.

LinkTo<TOutput>(ISourceBlock<TOutput>, ITargetBlock<TOutput>, DataflowLinkOptions, Predicate<TOutput>)

用指定的筛选器将 ISourceBlock<TOutput> 链接到指定的 ITargetBlock<TInput>Links the ISourceBlock<TOutput> to the specified ITargetBlock<TInput> using the specified filter.

OutputAvailableAsync<TOutput>(ISourceBlock<TOutput>)

提供可异步监视可利用的输出的源的 Task<TResult>Provides a Task<TResult> that asynchronously monitors the source for available output.

OutputAvailableAsync<TOutput>(ISourceBlock<TOutput>, CancellationToken)

提供 Task<TResult>,用于以异步方式监视可用输出的源。Provides a Task<TResult> that asynchronously monitors the source for available output.

Receive<TOutput>(ISourceBlock<TOutput>)

同步接收来自指定源的值。Synchronously receives a value from a specified source.

Receive<TOutput>(ISourceBlock<TOutput>, CancellationToken)

同步从指定的数据源中接收值并提供标记来取消操作。Synchronously receives a value from a specified source and provides a token to cancel the operation.

Receive<TOutput>(ISourceBlock<TOutput>, TimeSpan)

同步从指定的数据源中接收值,观察可选的超时期限。Synchronously receives a value from a specified source, observing an optional time-out period.

Receive<TOutput>(ISourceBlock<TOutput>, TimeSpan, CancellationToken)

同步从指定的数据源中接收值,提供标记以取消操作并观察可选的超时间隔。Synchronously receives a value from a specified source, providing a token to cancel the operation and observing an optional time-out interval.

ReceiveAsync<TOutput>(ISourceBlock<TOutput>)

异步接收来自指定源的值。Asynchronously receives a value from a specified source.

ReceiveAsync<TOutput>(ISourceBlock<TOutput>, CancellationToken)

异步从指定的数据源中接收值并提供标记来取消操作。Asynchronously receives a value from a specified source and provides a token to cancel the operation.

ReceiveAsync<TOutput>(ISourceBlock<TOutput>, TimeSpan)

异步从指定的数据源中接收值,观察可选的超时期限。Asynchronously receives a value from a specified source, observing an optional time-out period.

ReceiveAsync<TOutput>(ISourceBlock<TOutput>, TimeSpan, CancellationToken)

异步从指定的数据源中接收值,提供标记以取消操作并观察可选的超时间隔。Asynchronously receives a value from a specified source, providing a token to cancel the operation and observing an optional time-out interval.

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

尝试从 ISourceBlock<TOutput> 中同步接收一个项目。Attempts to synchronously receive an item from the ISourceBlock<TOutput>.

适用于