Rediger

Del via


BatchedJoinBlock<T1,T2>.TryReceive Method

Definition

Attempts to synchronously receive an available output item from the IReceivableSourceBlock<TOutput>.

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

Parameters

filter
Predicate<Tuple<IList<T1>,IList<T2>>>

The predicate a value must successfully pass in order for it to be received. filter may be null, in which case all items will pass.

item
Tuple<IList<T1>,IList<T2>>

The item received from the source.

Returns

true if an item could be received; otherwise, false.

Remarks

This method does not block waiting for the source to provide an item.

It will return after checking for an element, whether or not an element was available.

Applies to