WriteOnceBlock<T>
Class
Definition
Provides a buffer for receiving and storing at most one element in a network of dataflow blocks.
public sealed class WriteOnceBlock<T> : System.Threading.Tasks.Dataflow.IPropagatorBlock<T,T>, System.Threading.Tasks.Dataflow.IReceivableSourceBlock<T>, System.Threading.Tasks.Dataflow.ISourceBlock<T>, System.Threading.Tasks.Dataflow.ITargetBlock<T>
- T
Specifies the type of the data buffered by this dataflow block.
- Inheritance
-
WriteOnceBlock<T>
- Implements
Inherited Members
System.Object
Remarks
Note
The TPL Dataflow Library (System.Threading.Tasks.Dataflow namespace) is not distributed with the .NET Framework 4.5. To install the System.Threading.Tasks.Dataflow namespace, open your project in Visual Studio 2012, choose Manage NuGet Packages from the Project menu, and search online for the Microsoft.Tpl.Dataflow package.
Constructors
| WriteOnceBlock<T>(Func<T,T>) |
Initializes a new WriteOnceBlock<T>. |
| WriteOnceBlock<T>(Func<T,T>, DataflowBlockOptions) |
Initializes a new WriteOnceBlock<T> with the specified DataflowBlockOptions. |
Properties
| Completion |
Gets a Task that represents the asynchronous operation and completion of the dataflow block. |
Methods
| Complete() |
Signals to the IDataflowBlock that it should not accept nor produce any more messages nor consume any more postponed messages. |
| LinkTo(ITargetBlock<T>, DataflowLinkOptions) |
Links the ISourceBlock<TOutput> to the specified ITargetBlock<TInput> . |
| ToString() |
Returns a string that represents the formatted name of this IDataflowBlock instance. |
| TryReceive(Predicate<T>, T) |
Attempts to synchronously receive an available output item from the IReceivableSourceBlock<TOutput>. |