Flow.Processor<List<ByteBuffer>, List<ByteBuffer>>
,
but rather models a publisher source and a subscriber sink in a bidirectional flow.
The connectFlows
method should be called to connect the bidirectional
flow. A FlowTube supports handing over the same read subscription to different
sequential read subscribers over time. When connectFlows(writePublisher,
readSubscriber
is called, the FlowTube will call dropSubscription
on
its former readSubscriber, and onSubscribe
on its new readSubscriber.
Modifier and Type | Class and Description |
---|---|
public abstract static class | FlowTube.
Convenience abstract class for |
public abstract static class | FlowTube.
Convenience abstract class for |
public static interface | FlowTube.
A publisher for writing to the bidirectional flow. |
public static interface | FlowTube.
A subscriber for reading from the bidirectional flow. |
Modifier and Type | Method and Description |
---|---|
public static FlowTube. | Returns: aTubePublisher : either s if s is a
TubePublisher , otherwise a TubePublisher
wrapper that delegates to s a publisher for writing. pReturns |
public static FlowTube. | Returns: aTubeSubscriber : either s if s is a
TubeSubscriber , otherwise a TubeSubscriber
wrapper that delegates to s a subscriber for reading. sReturns |
public default void | connectFlows(FlowTube.
A new publisher for writing to the bidirectional flow. writePublisher,A new subscriber for reading from the bidirectional
flow. readSubscriberConnects the bidirectional flows to a write |
public boolean | Returns: true if the flow is finishedReturns true if this flow was completed, either exceptionally or normally (EOF reached). |
asTubePublisher | back to summary |
---|---|
public static FlowTube. Returns
|
asTubeSubscriber | back to summary |
---|---|
public static FlowTube. Returns
|
connectFlows | back to summary |
---|---|
public default void connectFlows(FlowTube. Connects the bidirectional flows to a write
|
isFinished | back to summary |
---|---|
public boolean isFinished() Returns true if this flow was completed, either exceptionally or normally (EOF reached).
|
TubePublisher
implementations.
It is not required that a TubePublisher
implementation extends
this class.
Modifier and Type | Class and Description |
---|---|
pack-priv static class |
Access | Constructor and Description |
---|---|
public |
AbstractTubePublisher | back to summary |
---|---|
public AbstractTubePublisher() |
Modifier and Type | Field and Description |
---|---|
pack-priv final Flow. |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public void | subscribe(Flow.
the subscriber subscriberImplements java. Adds the given Subscriber if possible. |
delegate | back to summary |
---|---|
pack-priv final Flow. |
TubePublisherWrapper | back to summary |
---|---|
public TubePublisherWrapper(Flow. |
subscribe | back to summary |
---|---|
public void subscribe(Flow. Implements java. Doc from java. Adds the given Subscriber if possible. If already
subscribed, or the attempt to subscribe fails due to policy
violations or errors, the Subscriber's
|
TubeSubscriber
implementations.
It is not required that a TubeSubscriber
implementation extends
this class.
Modifier and Type | Class and Description |
---|---|
pack-priv static class |
Access | Constructor and Description |
---|---|
public |
AbstractTubeSubscriber | back to summary |
---|---|
public AbstractTubeSubscriber() |
Modifier and Type | Field and Description |
---|---|
pack-priv final Flow. |
Access | Constructor and Description |
---|---|
pack-priv |
Modifier and Type | Method and Description |
---|---|
public void | dropSubscription()
Overrides default jdk. Called when the flow is connected again, and the subscription is handed over to a new subscriber. |
public void | onComplete()
Implements java. Method invoked when it is known that no additional Subscriber method invocations will occur for a Subscription that is not already terminated by error, after which no other Subscriber methods are invoked by the Subscription. |
public void | onError(Throwable
the exception throwable)Implements java. Method invoked upon an unrecoverable error encountered by a Publisher or Subscription, after which no other Subscriber methods are invoked by the Subscription. |
public void | onNext(List<ByteBuffer>
the item item)Implements java. Method invoked with a Subscription's next item. |
public void | onSubscribe(Flow.
a new subscription subscriptionImplements java. Method invoked prior to invoking any other Subscriber methods for the given Subscription. |
delegate | back to summary |
---|---|
pack-priv final Flow. |
TubeSubscriberWrapper | back to summary |
---|---|
pack-priv TubeSubscriberWrapper(Flow. |
dropSubscription | back to summary |
---|---|
public void dropSubscription() Overrides default jdk. Doc from jdk. Called when the flow is connected again, and the subscription
is handed over to a new subscriber.
Once
|
onComplete | back to summary |
---|---|
public void onComplete() Implements java. Doc from java. Method invoked when it is known that no additional Subscriber method invocations will occur for a Subscription that is not already terminated by error, after which no other Subscriber methods are invoked by the Subscription. If this method throws an exception, resulting behavior is undefined.
|
onError | back to summary |
---|---|
public void onError(Throwable throwable) Implements java. Doc from java. Method invoked upon an unrecoverable error encountered by a Publisher or Subscription, after which no other Subscriber methods are invoked by the Subscription. If this method itself throws an exception, resulting behavior is undefined. |
onNext | back to summary |
---|---|
public void onNext(List<ByteBuffer> item) Implements java. Doc from java. Method invoked with a Subscription's next item. If this method throws an exception, resulting behavior is not guaranteed, but may cause the Subscription to be cancelled.
|
onSubscribe | back to summary |
---|---|
public void onSubscribe(Flow. Implements java. Doc from java. Method invoked prior to invoking any other Subscriber methods for the given Subscription. If this method throws an exception, resulting behavior is not guaranteed, but may cause the Subscription not to be established or to be cancelled. Typically, implementations of this method invoke
|
Flow.Subscriber
that can be canceled
by calling dropSubscription()
.
Once dropSubscription()
is called, the TubeSubscriber
should stop calling any method on its subscription.
Modifier and Type | Method and Description |
---|---|
public default void | dropSubscription()
Called when the flow is connected again, and the subscription is handed over to a new subscriber. |
public default boolean |
dropSubscription | back to summary |
---|---|
public default void dropSubscription() Called when the flow is connected again, and the subscription
is handed over to a new subscriber.
Once |
supportsRecycling | back to summary |
---|---|
public default boolean supportsRecycling() |