T
- the published item typeFlow.Processor<T,R>
, HttpRequest.BodyPublisher
SubmissionPublisher
Flow
@FunctionalInterface public static interface Flow.Publisher<T>
Flow.Subscriber
receives the same items (via method onNext
) in the same order, unless drops or errors are encountered. If a Publisher encounters an error that does not allow items to be issued to a Subscriber, that Subscriber receives onError
, and then receives no further messages. Otherwise, when it is known that no further messages will be issued to it, a subscriber receives
onComplete
. Publishers ensure that Subscriber method invocations for each subscription are strictly ordered in happens-before order. Publishers may vary in policy about whether drops (failures to issue an item because of resource limitations) are treated as unrecoverable errors. Publishers may also vary about whether Subscribers receive items that were produced or available before they subscribed.
Modifier and Type | Method | Description |
---|---|---|
void |
subscribe |
Adds the given Subscriber if possible. |
void subscribe(Flow.Subscriber<? super T> subscriber)
onError
method is invoked with an IllegalStateException
. Otherwise, the Subscriber's onSubscribe
method is invoked with a new Flow.Subscription
. Subscribers may enable receiving items by invoking the request
method of this Subscription, and may unsubscribe by invoking its cancel
method.subscriber
- the subscriberNullPointerException
- if subscriber is null
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/concurrent/Flow.Publisher.html