BatchBlock<T>.TryReceive(Predicate<T[]>, T[]) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Attempts to synchronously receive an available output item from the IReceivableSourceBlock<TOutput>.
public:
virtual bool TryReceive(Predicate<cli::array <T> ^> ^ filter, [Runtime::InteropServices::Out] cli::array <T> ^ % item);
public bool TryReceive (Predicate<T[]> filter, 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
Parameters
- filter
- Predicate<T[]>
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
- T[]
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
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour