public class ReadableByteChannelPublisher extends java.lang.Object implements Flow.Publisher<DataChunk>
subscriber. If channel doesn't offer data, then it is requested
again after some period defined be retry schema.
Only first subscriber is accepted.
| Constructor and Description |
|---|
ReadableByteChannelPublisher(java.nio.channels.ReadableByteChannel channel,
RetrySchema retrySchema)
Creates new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
subscribe(Flow.Subscriber<? super DataChunk> subscriberParam)
Adds the given Subscriber if possible.
|
public ReadableByteChannelPublisher(java.nio.channels.ReadableByteChannel channel,
RetrySchema retrySchema)
channel - a channel to read and publishretrySchema - a retry schema functional interface used in case, that channel read retrieved zero bytes.public void subscribe(Flow.Subscriber<? super DataChunk> subscriberParam)
Flow.PublisheronError
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.subscribe in interface Flow.Publisher<DataChunk>subscriberParam - the subscriberCopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.