BodySubscriber
and Flow.Subscriber<String>
.
Modifier and Type | Class and Description |
---|---|
pack-priv static class |
Modifier and Type | Field and Description |
---|---|
private final CompletableFuture | |
private final Charset | |
private volatile LineSubscriberAdapter. | |
private final String | |
private final Function | |
private final AtomicBoolean | |
private final S |
Access | Constructor and Description |
---|---|
private | LineSubscriberAdapter(S subscriber, Function<? super S, ? extends R> finisher, Charset charset, String eol)
|
Modifier and Type | Method and Description |
---|---|
public static <S extends Flow. | |
public CompletionStage | getBody()
Implements java. CompletionStage which when completed will return
the response body object.
|
public void | onComplete()
Implements java. |
public void | onError(Throwable
the exception throwable)Implements java. |
public void | onNext(List<ByteBuffer>
the item item)Implements java. |
public void | onSubscribe(Flow.
a new subscription subscriptionImplements java. |
cf | back to summary |
---|---|
private final CompletableFuture<R> cf |
charset | back to summary |
---|---|
private final Charset charset |
downstream | back to summary |
---|---|
private volatile LineSubscriberAdapter. |
eol | back to summary |
---|---|
private final String eol |
finisher | back to summary |
---|---|
private final Function<? super S, ? extends R> finisher |
subscribed | back to summary |
---|---|
private final AtomicBoolean subscribed |
subscriber | back to summary |
---|---|
private final S subscriber |
LineSubscriberAdapter | back to summary |
---|---|
private LineSubscriberAdapter(S subscriber, Function<? super S, ? extends R> finisher, Charset charset, String eol) |
create | back to summary |
---|---|
public static <S extends Flow. |
getBody | back to summary |
---|---|
public CompletionStage Implements java. Doc from java. Returns a
|
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
|
Modifier and Type | Field and Description |
---|---|
private final CharBuffer | |
private final StringBuilder | |
private volatile boolean | |
pack-priv final CompletableFuture | |
private final char[] | |
private volatile boolean | |
pack-priv final CharsetDecoder | |
private final AtomicLong | |
pack-priv final Demand | |
private final AtomicReference | |
private final ByteBuffer | |
pack-priv final String | |
private String | |
pack-priv final ConcurrentLinkedDeque | |
pack-priv final SequentialScheduler | |
pack-priv final Flow. | |
pack-priv final Flow. |
Access | Constructor and Description |
---|---|
private | LineSubscription(Flow.
|
Modifier and Type | Method and Description |
---|---|
public void | cancel()
Implements java. |
pack-priv static LineSubscriberAdapter. | create(Flow.
|
private static int | |
private boolean | |
private void | |
private static String | |
private String | |
public void | request(long
the increment of demand; a value of n)Long.MAX_VALUE may be considered as effectively unboundedImplements java. n of items to the current
unfulfilled demand for this subscription.
|
public void | |
public void | |
public void | |
private static String |
buffer | back to summary |
---|---|
private final CharBuffer buffer |
builder | back to summary |
---|---|
private final StringBuilder builder |
cancelled | back to summary |
---|---|
private volatile boolean cancelled |
cf | back to summary |
---|---|
pack-priv final CompletableFuture<?> cf |
chars | back to summary |
---|---|
private final char[] chars |
completed | back to summary |
---|---|
private volatile boolean completed |
decoder | back to summary |
---|---|
pack-priv final CharsetDecoder decoder |
demanded | back to summary |
---|---|
private final AtomicLong demanded |
downstreamDemand | back to summary |
---|---|
pack-priv final Demand downstreamDemand |
errorRef | back to summary |
---|---|
private final AtomicReference<Throwable> errorRef |
leftover | back to summary |
---|---|
private final ByteBuffer leftover |
newline | back to summary |
---|---|
pack-priv final String newline |
nextLine | back to summary |
---|---|
private String nextLine |
queue | back to summary |
---|---|
pack-priv final ConcurrentLinkedDeque<ByteBuffer> queue |
scheduler | back to summary |
---|---|
pack-priv final SequentialScheduler scheduler |
upstream | back to summary |
---|---|
pack-priv final Flow. |
upstreamSubscription | back to summary |
---|---|
pack-priv final Flow. |
LineSubscription | back to summary |
---|---|
private LineSubscription(Flow. |
cancel | back to summary |
---|---|
public void cancel() Implements java. Doc from java. Causes the Subscriber to (eventually) stop receiving
messages. Implementation is best-effort -- additional
messages may be received after invoking this method.
A cancelled subscription need not ever receive an
|
create | back to summary |
---|---|
pack-priv static LineSubscriberAdapter. |
endOfLine | back to summary |
---|---|
private static int endOfLine(StringBuilder b, String eol, boolean endOfInput) |
isUnderFlow | back to summary |
---|---|
private boolean isUnderFlow(ByteBuffer in, CharBuffer out, boolean endOfInput) throws CharacterCodingException |
loop | back to summary |
---|---|
private void loop() |
nextLine | back to summary |
---|---|
private static String nextLine(StringBuilder b, String eol, boolean endOfInput) |
nextLine | back to summary |
---|---|
private String nextLine() throws CharacterCodingException |
request | back to summary |
---|---|
public void request(long n) Implements java. Doc from java. Adds the given number
|
signalComplete | back to summary |
---|---|
public void signalComplete() |
signalError | back to summary |
---|---|
public void signalError(Throwable error) |
submit | back to summary |
---|---|
public void submit(List<ByteBuffer> list) |
take | back to summary |
---|---|
private static String take(StringBuilder b, int start, int end) |