BufferBlock<T>.TryReceive(Predicate<T>, T) Método

Definição

Tentativas de receber síncronicamente um item de saída disponível do IReceivableSourceBlock<TOutput>.

public:
 virtual bool TryReceive(Predicate<T> ^ filter, [Runtime::InteropServices::Out] T % item);
public bool TryReceive(Predicate<T> filter, out T item);
abstract member TryReceive : Predicate<'T> * 'T -> bool
override this.TryReceive : Predicate<'T> * 'T -> bool
Public Function TryReceive (filter As Predicate(Of T), ByRef item As T) As Boolean

Parâmetros

filter
Predicate<T>

O valor do predicado deve passar com sucesso para ser recebido. filter pode ser null, caso em que todos os itens passam.

item
T

O item recebido da fonte.

Devoluções

true se um item pudesse ser recebido; caso contrário, false.

Observações

Este método não bloqueia a espera que a fonte forneça um item.

Ele retorna após verificar se há um elemento, se este estava disponível ou não.

Aplica-se a