Package org.reactivestreams
Class FlowAdapters.ReactivePublisherFromFlow<T>
- java.lang.Object
-
- org.reactivestreams.FlowAdapters.ReactivePublisherFromFlow<T>
-
- Type Parameters:
T
- the element type
- All Implemented Interfaces:
Publisher<T>
- Enclosing class:
- FlowAdapters
static final class FlowAdapters.ReactivePublisherFromFlow<T> extends java.lang.Object implements Publisher<T>
Reactive Streams Publisher that wraps a Flow Publisher.
-
-
Constructor Summary
Constructors Constructor Description ReactivePublisherFromFlow(java.util.concurrent.Flow.Publisher<? extends T> flowPublisher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
subscribe(Subscriber<? super T> reactive)
RequestPublisher
to start streaming data.
-
-
-
Field Detail
-
flow
final java.util.concurrent.Flow.Publisher<? extends T> flow
-
-
Constructor Detail
-
ReactivePublisherFromFlow
public ReactivePublisherFromFlow(java.util.concurrent.Flow.Publisher<? extends T> flowPublisher)
-
-
Method Detail
-
subscribe
public void subscribe(Subscriber<? super T> reactive)
Description copied from interface:Publisher
RequestPublisher
to start streaming data.This is a "factory method" and can be called multiple times, each time starting a new
Subscription
.Each
Subscription
will work for only a singleSubscriber
.A
Subscriber
should only subscribe once to a singlePublisher
.If the
Publisher
rejects the subscription attempt or otherwise fails it will signal the error viaSubscriber.onError(Throwable)
.- Specified by:
subscribe
in interfacePublisher<T>
- Parameters:
reactive
- theSubscriber
that will consume signals from thisPublisher
-
-