SubmissionPublisher.Subscribe(Flow+ISubscriber) 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.
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.