Lingua

SubmissionPublisher.Subscribe(Flow+ISubscriber) Method

Definition

Adds the given Subscriber unless already subscribed.

[Android.Runtime.Register("subscribe", "(Ljava/util/concurrent/Flow$Subscriber;)V", "GetSubscribe_Ljava_util_concurrent_Flow_Subscriber_Handler", ApiSince=33)]
public virtual void Subscribe(Java.Util.Concurrent.Flow.ISubscriber? subscriber);
[<Android.Runtime.Register("subscribe", "(Ljava/util/concurrent/Flow$Subscriber;)V", "GetSubscribe_Ljava_util_concurrent_Flow_Subscriber_Handler", ApiSince=33)>]
abstract member Subscribe : Java.Util.Concurrent.Flow.ISubscriber -> unit
override this.Subscribe : Java.Util.Concurrent.Flow.ISubscriber -> unit

Parameters

subscriber
Flow.ISubscriber

the subscriber

Implements

Attributes

Remarks

Adds the given Subscriber unless already subscribed. If already subscribed, the Subscriber's onError method is invoked on the existing subscription with an IllegalStateException. Otherwise, upon success, the Subscriber's onSubscribe method is invoked asynchronously with a new Flow.Subscription. If onSubscribe throws an exception, the subscription is cancelled. Otherwise, if this SubmissionPublisher was closed exceptionally, then the subscriber's onError method is invoked with the corresponding exception, or if closed without exception, the subscriber's onComplete method is invoked. Subscribers may enable receiving items by invoking the request method of the new Subscription, and may unsubscribe by invoking its cancel method.

Java reference for java.util.concurrent.SubmissionPublisher.subscribe.

Applies to