LinkedTransferQueue.TryTransfer Method

Definition

Overloads

TryTransfer(Object)

Transfers the element to a waiting consumer immediately, if possible.

TryTransfer(Object, Int64, TimeUnit)

Transfers the element to a consumer if it is possible to do so before the timeout elapses.

TryTransfer(Object)

Transfers the element to a waiting consumer immediately, if possible.

[Android.Runtime.Register("tryTransfer", "(Ljava/lang/Object;)Z", "GetTryTransfer_Ljava_lang_Object_Handler")]
public virtual bool TryTransfer (Java.Lang.Object? e);
[<Android.Runtime.Register("tryTransfer", "(Ljava/lang/Object;)Z", "GetTryTransfer_Ljava_lang_Object_Handler")>]
abstract member TryTransfer : Java.Lang.Object -> bool
override this.TryTransfer : Java.Lang.Object -> bool

Parameters

e
Object

Returns

Implements

Attributes

Remarks

Transfers the element to a waiting consumer immediately, if possible.

More precisely, transfers the specified element immediately if there exists a consumer already waiting to receive it (in #take or timed #poll(long,TimeUnit) poll), otherwise returning false without enqueuing the element.

Java documentation for java.util.concurrent.LinkedTransferQueue.tryTransfer(E).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

TryTransfer(Object, Int64, TimeUnit)

Transfers the element to a consumer if it is possible to do so before the timeout elapses.

[Android.Runtime.Register("tryTransfer", "(Ljava/lang/Object;JLjava/util/concurrent/TimeUnit;)Z", "GetTryTransfer_Ljava_lang_Object_JLjava_util_concurrent_TimeUnit_Handler")]
public virtual bool TryTransfer (Java.Lang.Object? e, long timeout, Java.Util.Concurrent.TimeUnit? unit);
[<Android.Runtime.Register("tryTransfer", "(Ljava/lang/Object;JLjava/util/concurrent/TimeUnit;)Z", "GetTryTransfer_Ljava_lang_Object_JLjava_util_concurrent_TimeUnit_Handler")>]
abstract member TryTransfer : Java.Lang.Object * int64 * Java.Util.Concurrent.TimeUnit -> bool
override this.TryTransfer : Java.Lang.Object * int64 * Java.Util.Concurrent.TimeUnit -> bool

Parameters

e
Object
timeout
Int64
unit
TimeUnit

Returns

Implements

Attributes

Remarks

Transfers the element to a consumer if it is possible to do so before the timeout elapses.

More precisely, transfers the specified element immediately if there exists a consumer already waiting to receive it (in #take or timed #poll(long,TimeUnit) poll), else inserts the specified element at the tail of this queue and waits until the element is received by a consumer, returning false if the specified wait time elapses before the element can be transferred.

Java documentation for java.util.concurrent.LinkedTransferQueue.tryTransfer(E, long, java.util.concurrent.TimeUnit).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to