Flow.Publisher<ResponseChunk>public class ReadableByteChannelPublisher extends Object implements Flow.Publisher<ResponseChunk>
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 | Description |
|---|---|
ReadableByteChannelPublisher(ReadableByteChannel channel,
RetrySchema retrySchema) |
Creates new instance.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
subscribe(Flow.Subscriber<? super ResponseChunk> subscriberParam) |
Adds the given Subscriber if possible.
|
public ReadableByteChannelPublisher(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 ResponseChunk> 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<ResponseChunk>subscriberParam - the subscriberCopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.