Share via


SubmissionPublisher.Submit(Object) Method

Definition

Publishes the given item to each current subscriber by asynchronously invoking its Flow.Subscriber#onNext(Object) onNext method, blocking uninterruptibly while resources for any subscriber are unavailable.

[Android.Runtime.Register("submit", "(Ljava/lang/Object;)I", "GetSubmit_Ljava_lang_Object_Handler", ApiSince=33)]
public virtual int Submit (Java.Lang.Object? item);
[<Android.Runtime.Register("submit", "(Ljava/lang/Object;)I", "GetSubmit_Ljava_lang_Object_Handler", ApiSince=33)>]
abstract member Submit : Java.Lang.Object -> int
override this.Submit : Java.Lang.Object -> int

Parameters

item
Object

the (non-null) item to publish

Returns

the estimated maximum lag among subscribers

Attributes

Remarks

Publishes the given item to each current subscriber by asynchronously invoking its Flow.Subscriber#onNext(Object) onNext method, blocking uninterruptibly while resources for any subscriber are unavailable. This method returns an estimate of the maximum lag (number of items submitted but not yet consumed) among all current subscribers. This value is at least one (accounting for this submitted item) if there are any subscribers, else zero.

If the Executor for this publisher throws a RejectedExecutionException (or any other RuntimeException or Error) when attempting to asynchronously notify subscribers, then this exception is rethrown, in which case not all subscribers will have been issued this item.

Java documentation for java.util.concurrent.SubmissionPublisher.submit(T).

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