DataflowBlock.Receive DataflowBlock.Receive DataflowBlock.Receive DataflowBlock.Receive Method

Definición

Sobrecargas

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)

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)

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.

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.

public:
generic <typename TOutput>
[System::Runtime::CompilerServices::Extension]
 static TOutput Receive(System::Threading::Tasks::Dataflow::ISourceBlock<TOutput> ^ source);
public static TOutput Receive<TOutput> (this System.Threading.Tasks.Dataflow.ISourceBlock<TOutput> source);
static member Receive : System.Threading.Tasks.Dataflow.ISourceBlock<'Output> -> 'Output
<Extension()>
Public Function Receive(Of TOutput) (source As ISourceBlock(Of TOutput)) As TOutput

Parámetros de tipo

TOutput

El tipo de los datos contenido del origen de datos.The type of data contained in the source.

Parámetros

source
ISourceBlock<TOutput> ISourceBlock<TOutput> ISourceBlock<TOutput> ISourceBlock<TOutput>

Origen del que se va a recibir el valor.The source from which to receive the value.

Devoluciones

TOutput TOutput TOutput TOutput

El valor recibido.The received value.

Excepciones

No se pudo recibir ningún elemento del origen.No item could be received from the source.

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.

public:
generic <typename TOutput>
[System::Runtime::CompilerServices::Extension]
 static TOutput Receive(System::Threading::Tasks::Dataflow::ISourceBlock<TOutput> ^ source, System::Threading::CancellationToken cancellationToken);
public static TOutput Receive<TOutput> (this System.Threading.Tasks.Dataflow.ISourceBlock<TOutput> source, System.Threading.CancellationToken cancellationToken);
static member Receive : System.Threading.Tasks.Dataflow.ISourceBlock<'Output> * System.Threading.CancellationToken -> 'Output

Parámetros de tipo

TOutput

El tipo de los datos contenido del origen de datos.The type of data contained in the source.

Parámetros

source
ISourceBlock<TOutput> ISourceBlock<TOutput> ISourceBlock<TOutput> ISourceBlock<TOutput>

Origen del que se va a recibir el valor.The source from which to receive the value.

cancellationToken
CancellationToken CancellationToken CancellationToken CancellationToken

El token que se va a utilizar para cancelar la selección la operación de recepción.The token to use to cancel the receive operation.

Devoluciones

TOutput TOutput TOutput TOutput

El valor recibido.The received value.

Excepciones

No se pudo recibir ningún elemento del origen.No item could be received from the source.

Se canceló la operación antes de que se recibiera un elemento del origen.The operation was canceled before an item was received from the source.

Comentarios

Si el origen ofrecía correctamente un elemento recibido por esta operación, dicho elemento se devuelve incluso si se produce una solicitud de cancelación simultánea.If the source successfully offered an item that was received by this operation, that item is returned even if a concurrent cancellation request occurs.

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.

public:
generic <typename TOutput>
[System::Runtime::CompilerServices::Extension]
 static TOutput Receive(System::Threading::Tasks::Dataflow::ISourceBlock<TOutput> ^ source, TimeSpan timeout);
public static TOutput Receive<TOutput> (this System.Threading.Tasks.Dataflow.ISourceBlock<TOutput> source, TimeSpan timeout);
static member Receive : System.Threading.Tasks.Dataflow.ISourceBlock<'Output> * TimeSpan -> 'Output
<Extension()>
Public Function Receive(Of TOutput) (source As ISourceBlock(Of TOutput), timeout As TimeSpan) As TOutput

Parámetros de tipo

TOutput

El tipo de los datos contenido del origen de datos.The type of data contained in the source.

Parámetros

source
ISourceBlock<TOutput> ISourceBlock<TOutput> ISourceBlock<TOutput> ISourceBlock<TOutput>

Origen del que se va a recibir el valor.The source from which to receive the value.

timeout
TimeSpan TimeSpan TimeSpan TimeSpan

El intervalo de tiempo máximo, en milisegundos, para esperar la operación síncrona para completar, o un intervalo que representa -1 milisegundos para esperar indefinidamente.The maximum time interval, in milliseconds, to wait for the synchronous operation to complete, or an interval that represents -1 milliseconds to wait indefinitely.

Devoluciones

TOutput TOutput TOutput TOutput

El valor recibido.The received value.

Excepciones

timeout es un número negativo distinto de -1 milisegundo que representa un período de espera infinito.timeout is a negative number other than -1 milliseconds, which represents an infinite time-out period.

O bien-or- timeout es mayor que MaxValue.timeout is greater than MaxValue.

No se pudo recibir ningún elemento del origen.No item could be received from the source.

El tiempo de espera especificado expiró antes de que se recibiera un elemento del origen.The specified time-out expired before an item was received from the source.

Comentarios

Si el origen ofrecía correctamente un elemento recibido por esta operación, ese elemento se devuelve incluso si se produce un tiempo de espera simultáneo.If the source successfully offered an item that was received by this operation, that item is returned even if a concurrent time-out occurs.

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.

public:
generic <typename TOutput>
[System::Runtime::CompilerServices::Extension]
 static TOutput Receive(System::Threading::Tasks::Dataflow::ISourceBlock<TOutput> ^ source, TimeSpan timeout, System::Threading::CancellationToken cancellationToken);
public static TOutput Receive<TOutput> (this System.Threading.Tasks.Dataflow.ISourceBlock<TOutput> source, TimeSpan timeout, System.Threading.CancellationToken cancellationToken);
static member Receive : System.Threading.Tasks.Dataflow.ISourceBlock<'Output> * TimeSpan * System.Threading.CancellationToken -> 'Output

Parámetros de tipo

TOutput

El tipo de los datos contenido del origen de datos.The type of data contained in the source.

Parámetros

source
ISourceBlock<TOutput> ISourceBlock<TOutput> ISourceBlock<TOutput> ISourceBlock<TOutput>

Origen del que se va a recibir el valor.The source from which to receive the value.

timeout
TimeSpan TimeSpan TimeSpan TimeSpan

El intervalo de tiempo máximo, en milisegundos, para esperar la operación síncrona para completar, o un intervalo que representa -1 milisegundos para esperar indefinidamente.The maximum time interval, in milliseconds, to wait for the synchronous operation to complete, or an interval that represents -1 milliseconds to wait indefinitely.

cancellationToken
CancellationToken CancellationToken CancellationToken CancellationToken

El token que se va a utilizar para cancelar la selección la operación de recepción.The token to use to cancel the receive operation.

Devoluciones

TOutput TOutput TOutput TOutput

El valor recibido.The received value.

Excepciones

timeout es un número negativo distinto de -1 milisegundo que representa un período de espera infinito.timeout is a negative number other than -1 milliseconds, which represents an infinite time-out period.

O bien-or- timeout es mayor que MaxValue.timeout is greater than MaxValue.

No se pudo recibir ningún elemento del origen.No item could be received from the source.

El tiempo de espera especificado expiró antes de que se recibiera un elemento del origen.The specified time-out expired before an item was received from the source.

Se canceló la operación antes de que se recibiera un elemento del origen.The operation was canceled before an item was received from the source.

Comentarios

Si el origen ofrecía correctamente un valor de elemento recibido por esta operación, se devuelve ese valor incluso si se produce una solicitud de tiempo de espera simultánea o de cancelación.If the source successfully offered an item value that was received by this operation, that value is returned even if a concurrent time-out or cancellation request occurs.

Se aplica a