WriteOnceBlock<T> WriteOnceBlock<T> WriteOnceBlock<T> WriteOnceBlock<T> Class

Definición

Proporciona un búfer para recibir y almacenar a lo sumo un elemento en una red de bloques de flujo de datos.Provides a buffer for receiving and storing at most one element in a network of dataflow blocks.

generic <typename T>
public ref class WriteOnceBlock sealed : 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>
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>
type WriteOnceBlock<'T> = class
    interface IDataflowBlock
    interface IPropagatorBlock<'T, 'T>
    interface ISourceBlock<'T>
    interface ITargetBlock<'T>
    interface IReceivableSourceBlock<'T>
Public NotInheritable Class WriteOnceBlock(Of T)
Implements IPropagatorBlock(Of T, T), IReceivableSourceBlock(Of T), ISourceBlock(Of T), ITargetBlock(Of T)

Parámetros de tipo

T

Especifica el tipo de los datos almacenados en el búfer por este bloque de flujo de datos.Specifies the type of the data buffered by this dataflow block.

Herencia
WriteOnceBlock<T>WriteOnceBlock<T>WriteOnceBlock<T>WriteOnceBlock<T>
Implementaciones

Comentarios

Nota

La biblioteca de flujos de datos TPL (el espacio de nombres System.Threading.Tasks.Dataflow) no se distribuye con .NET.The TPL Dataflow Library (the System.Threading.Tasks.Dataflow namespace) is not distributed with .NET. Para instalar el espacio de nombres System.Threading.Tasks.Dataflow en Visual Studio, abra el proyecto, seleccione Administrar paquetes NuGet en el menú Proyecto y busque en línea el paquete 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. Como alternativa, para realizar la instalación con la CLI de .Net Core, ejecute dotnet add package System.Threading.Tasks.Dataflow.Alternatively, to install it using the .NET Core CLI, run dotnet add package System.Threading.Tasks.Dataflow.

Constructores

WriteOnceBlock<T>(Func<T,T>) WriteOnceBlock<T>(Func<T,T>) WriteOnceBlock<T>(Func<T,T>) WriteOnceBlock<T>(Func<T,T>)

Inicializa un nuevo objeto WriteOnceBlock<T>.Initializes a new WriteOnceBlock<T>.

WriteOnceBlock<T>(Func<T,T>, DataflowBlockOptions) WriteOnceBlock<T>(Func<T,T>, DataflowBlockOptions) WriteOnceBlock<T>(Func<T,T>, DataflowBlockOptions) WriteOnceBlock<T>(Func<T,T>, DataflowBlockOptions)

Inicializa un WriteOnceBlock<T> nuevo con las DataflowBlockOptions especificadas.Initializes a new WriteOnceBlock<T> with the specified DataflowBlockOptions.

Propiedades

Completion Completion Completion Completion

Obtiene un objeto Task que representa la operación asincrónica y la finalización del bloque de flujo de datos.Gets a Task that represents the asynchronous operation and completion of the dataflow block.

Métodos

Complete() Complete() Complete() Complete()

Señala a IDataflowBlock que no debe aceptar ni mostrar más mensajes ni usar más mensajes pospuestos.Signals to the IDataflowBlock that it should not accept nor produce any more messages nor consume any more postponed messages.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determina si el objeto especificado es igual al objeto actual.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Sirve como la función hash predeterminada.Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Obtiene el Type de la instancia actual.Gets the Type of the current instance.

(Inherited from Object)
LinkTo(ITargetBlock<T>, DataflowLinkOptions) LinkTo(ITargetBlock<T>, DataflowLinkOptions) LinkTo(ITargetBlock<T>, DataflowLinkOptions) LinkTo(ITargetBlock<T>, DataflowLinkOptions)

Vincula el ISourceBlock<TOutput> al ITargetBlock<TInput> especificado.Links the ISourceBlock<TOutput> to the specified ITargetBlock<TInput> .

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Crea una copia superficial del objeto Object actual.Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Devuelve una cadena que representa el nombre con formato de esta instancia de IDataflowBlock.Returns a string that represents the formatted name of this IDataflowBlock instance.

TryReceive(Predicate<T>, T) TryReceive(Predicate<T>, T) TryReceive(Predicate<T>, T) TryReceive(Predicate<T>, T)

Intentos de recibir sincrónicamente un elemento de salida disponible de IReceivableSourceBlock<TOutput>.Attempts to synchronously receive an available output item from the IReceivableSourceBlock<TOutput>.

Implementaciones de interfaz explícitas

IDataflowBlock.Fault(Exception) IDataflowBlock.Fault(Exception) IDataflowBlock.Fault(Exception) IDataflowBlock.Fault(Exception)

Hace que la interfaz IDataflowBlock se complete en un estado Faulted .Causes the IDataflowBlock to complete in a Faulted state.

IReceivableSourceBlock<T>.TryReceiveAll(IList<T>) IReceivableSourceBlock<T>.TryReceiveAll(IList<T>) IReceivableSourceBlock<T>.TryReceiveAll(IList<T>) IReceivableSourceBlock<T>.TryReceiveAll(IList<T>)

Intentos de recibir sincrónicamente todos los elementos disponibles de IReceivableSourceBlock<TOutput>.Attempts to synchronously receive all available items from the IReceivableSourceBlock<TOutput>.

ISourceBlock<T>.ConsumeMessage(DataflowMessageHeader, ITargetBlock<T>, Boolean) ISourceBlock<T>.ConsumeMessage(DataflowMessageHeader, ITargetBlock<T>, Boolean) ISourceBlock<T>.ConsumeMessage(DataflowMessageHeader, ITargetBlock<T>, Boolean) ISourceBlock<T>.ConsumeMessage(DataflowMessageHeader, ITargetBlock<T>, Boolean)

Lo llama una interfaz ITargetBlock<TInput> vinculada para aceptar y usar una estructura DataflowMessageHeader ofrecida previamente por esta interfaz ISourceBlock<TOutput>.Called by a linked ITargetBlock<TInput> to accept and consume a DataflowMessageHeader previously offered by this ISourceBlock<TOutput>.

ISourceBlock<T>.ReleaseReservation(DataflowMessageHeader, ITargetBlock<T>) ISourceBlock<T>.ReleaseReservation(DataflowMessageHeader, ITargetBlock<T>) ISourceBlock<T>.ReleaseReservation(DataflowMessageHeader, ITargetBlock<T>) ISourceBlock<T>.ReleaseReservation(DataflowMessageHeader, ITargetBlock<T>)

Lo llama una interfaz ITargetBlock<TInput> vinculada para liberar una estructura DataflowMessageHeader reservada previamente por esta interfaz ISourceBlock<TOutput>.Called by a linked ITargetBlock<TInput> to release a previously reserved DataflowMessageHeader by this ISourceBlock<TOutput>.

ISourceBlock<T>.ReserveMessage(DataflowMessageHeader, ITargetBlock<T>) ISourceBlock<T>.ReserveMessage(DataflowMessageHeader, ITargetBlock<T>) ISourceBlock<T>.ReserveMessage(DataflowMessageHeader, ITargetBlock<T>) ISourceBlock<T>.ReserveMessage(DataflowMessageHeader, ITargetBlock<T>)

Lo llama una interfaz ITargetBlock<TInput> vinculada para reservar una estructura DataflowMessageHeader ofrecida previamente por esta interfaz ISourceBlock<TOutput>.Called by a linked ITargetBlock<TInput> to reserve a previously offered DataflowMessageHeader by this ISourceBlock<TOutput>.

ITargetBlock<T>.OfferMessage(DataflowMessageHeader, T, ISourceBlock<T>, Boolean) ITargetBlock<T>.OfferMessage(DataflowMessageHeader, T, ISourceBlock<T>, Boolean) ITargetBlock<T>.OfferMessage(DataflowMessageHeader, T, ISourceBlock<T>, Boolean) ITargetBlock<T>.OfferMessage(DataflowMessageHeader, T, ISourceBlock<T>, Boolean)

Ofrece un mensaje a ITargetBlock<TInput>, dando al destino la oportunidad de usar o de posponer el mensaje.Offers a message to the ITargetBlock<TInput>, giving the target the opportunity to consume or postpone the message.

Métodos de extensión

AsObservable<TOutput>(ISourceBlock<TOutput>) AsObservable<TOutput>(ISourceBlock<TOutput>) AsObservable<TOutput>(ISourceBlock<TOutput>) AsObservable<TOutput>(ISourceBlock<TOutput>)

Crea una nueva abstracción de la interfaz IObservable<T> sobre la interfaz ISourceBlock<TOutput>.Creates a new IObservable<T> abstraction over the ISourceBlock<TOutput>.

AsObserver<TInput>(ITargetBlock<TInput>) AsObserver<TInput>(ITargetBlock<TInput>) AsObserver<TInput>(ITargetBlock<TInput>) AsObserver<TInput>(ITargetBlock<TInput>)

Crea una abstracción de IObserver<T> sobre ITargetBlock<TInput>.Creates a new IObserver<T> abstraction over the ITargetBlock<TInput>.

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

Vincula el ISourceBlock<TOutput> al ITargetBlock<TInput> especificado.Links the ISourceBlock<TOutput> to the specified ITargetBlock<TInput>.

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

Vincula el ISourceBlock<TOutput> al ITargetBlock<TInput> especificado con el filtro especificado.Links the ISourceBlock<TOutput> to the specified ITargetBlock<TInput> using the specified filter.

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

Vincula el ISourceBlock<TOutput> al ITargetBlock<TInput> especificado con el filtro especificado.Links the ISourceBlock<TOutput> to the specified ITargetBlock<TInput> using the specified filter.

OutputAvailableAsync<TOutput>(ISourceBlock<TOutput>) OutputAvailableAsync<TOutput>(ISourceBlock<TOutput>) OutputAvailableAsync<TOutput>(ISourceBlock<TOutput>) OutputAvailableAsync<TOutput>(ISourceBlock<TOutput>)

Proporciona un objeto Task<TResult> que supervisa de forma asincrónica el origen de salida disponible.Provides a Task<TResult> that asynchronously monitors the source for available output.

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

Proporciona una Task<TResult> que supervisa de manera asincrónica la salida disponible en el origen.Provides a Task<TResult> that asynchronously monitors the source for available output.

Post<TInput>(ITargetBlock<TInput>, TInput) Post<TInput>(ITargetBlock<TInput>, TInput) Post<TInput>(ITargetBlock<TInput>, TInput) Post<TInput>(ITargetBlock<TInput>, TInput)

Publica un elemento a ITargetBlock<TInput>.Posts an item to the ITargetBlock<TInput>.

Receive<TOutput>(ISourceBlock<TOutput>) Receive<TOutput>(ISourceBlock<TOutput>) Receive<TOutput>(ISourceBlock<TOutput>) Receive<TOutput>(ISourceBlock<TOutput>)

Recibe de forma sincrónica un valor de un origen especificado.Synchronously receives a value from a specified source.

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

De forma sincrónica recibe un valor de un origen especificado y proporciona un token para cancelar la operación.Synchronously receives a value from a specified source and provides a token to cancel the operation.

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

De forma sincrónica recibe un valor de un origen especificado, observando un tiempo de espera opcional.Synchronously receives a value from a specified source, observing an optional time-out period.

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

De forma sincrónica recibe un valor de un origen especificado, proporcionando un token para cancelar la operación y observando un intervalo de tiempo de espera opcional.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>) ReceiveAsync<TOutput>(ISourceBlock<TOutput>) ReceiveAsync<TOutput>(ISourceBlock<TOutput>) ReceiveAsync<TOutput>(ISourceBlock<TOutput>)

Recibe de forma asincrónica un valor de un origen especificado.Asynchronously receives a value from a specified source.

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

De forma asincrónica recibe un valor de un origen especificado y proporciona un token para cancelar la operación.Asynchronously receives a value from a specified source and provides a token to cancel the operation.

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

De forma asincrónica recibe un valor de un origen especificado, observando un tiempo de espera opcional.Asynchronously receives a value from a specified source, observing an optional time-out period.

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

De forma asincrónica recibe un valor de un origen especificado, proporcionando un símbolo para anular la operación y observando un intervalo de tiempo de espera opcional.Asynchronously receives a value from a specified source, providing a token to cancel the operation and observing an optional time-out interval.

SendAsync<TInput>(ITargetBlock<TInput>, TInput) SendAsync<TInput>(ITargetBlock<TInput>, TInput) SendAsync<TInput>(ITargetBlock<TInput>, TInput) SendAsync<TInput>(ITargetBlock<TInput>, TInput)

De forma asincrónica proporciona un mensaje al bloque de mensajes de destino, teniendo en cuenta el aplazamiento.Asynchronously offers a message to the target message block, allowing for postponement.

SendAsync<TInput>(ITargetBlock<TInput>, TInput, CancellationToken) SendAsync<TInput>(ITargetBlock<TInput>, TInput, CancellationToken) SendAsync<TInput>(ITargetBlock<TInput>, TInput, CancellationToken) SendAsync<TInput>(ITargetBlock<TInput>, TInput, CancellationToken)

De forma asincrónica proporciona un mensaje al bloque de mensajes de destino, teniendo en cuenta el aplazamiento.Asynchronously offers a message to the target message block, allowing for postponement.

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

Se intenta recibir sincrónicamente un elemento de ISourceBlock<TOutput>.Attempts to synchronously receive an item from the ISourceBlock<TOutput>.

Se aplica a