BatchedJoinBlock<T1,T2>.TryReceive 方法

定义

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

参数

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

为使值得到检索,必须成功传递值的谓词。 filter 可能是 null ,在此情况下,所有项均将通过。

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

从源中检索到的项。

返回

Boolean

如果可以接收项,则为 true,否则为 false

注解

此方法不会阻止等待源提供项。

在检查某个元素后,它将返回该元素,该元素是否可用。

适用于