共用方式為


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>>

從來源接收的項目。

傳回

如果可以接收項目,則為 true,否則為 false

備註

此方法不會封鎖等候來源提供專案。

它會在檢查項目之後傳回,不論專案是否可用。

適用於