| Modifier and Type | Class and Description |
|---|---|
| pack-priv static interface | Http1AsyncReceiver.
A delegate that can asynchronously receive data from an upstream flow, parse, it, then possibly transform it and either store it (response headers) or possibly pass it to a downstream subscriber (response body). |
| private static class | Http1AsyncReceiver.
A simple subclass of AbstractSubscription that ensures the SequentialScheduler will be run when request() is called and demand becomes positive again. |
| pack-priv class | Http1AsyncReceiver.
A simple tube subscriber for reading from the connection flow. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final AtomicBoolean | |
| private final HttpClientImpl | |
| pack-priv volatile String | |
| pack-priv final Logger | |
| private volatile Http1AsyncReceiver. | |
| private volatile Throwable | |
| private final Executor | |
| private volatile Http1Exchange | |
| private final AtomicReference | |
| private final ConcurrentLinkedDeque | |
| private final AtomicLong | |
| private boolean | |
| private final SequentialScheduler | |
| private volatile boolean | |
| private final Http1AsyncReceiver. | |
| pack-priv final MinimalFuture |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | |
| private void | |
| pack-priv void | |
| pack-priv String | |
| private String | |
| private String | |
| pack-priv ByteBuffer | |
| private void | |
| private boolean | Returns: true if there was some pending delegate subscription and a new delegate was subscribed, false otherwise.Must be called from within the scheduler main loop. |
| private boolean | Returns: true if the delegate is not null and has some demandThe Http1AsyncDelegate delegate delegateMust be called from within the scheduler main loop. |
| pack-priv void | |
| pack-priv long | |
| pack-priv synchronized void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv FlowTube. | Returns: the TubeSubscriber for reading from the connection flow.Returns the TubeSubscriber for reading from the connection flow. |
| pack-priv void |
| canRequestMore | back to summary |
|---|---|
| pack-priv final AtomicBoolean canRequestMore | |
| client | back to summary |
|---|---|
| private final HttpClientImpl client | |
| dbgTag | back to summary |
|---|---|
| pack-priv volatile String dbgTag | |
| debug | back to summary |
|---|---|
| pack-priv final Logger debug | |
| delegate | back to summary |
|---|---|
| private volatile Http1AsyncReceiver. | |
| error | back to summary |
|---|---|
| private volatile Throwable error | |
| executor | back to summary |
|---|---|
| private final Executor executor | |
| owner | back to summary |
|---|---|
| private volatile Http1Exchange<?> owner | |
| pendingDelegateRef | back to summary |
|---|---|
| private final AtomicReference<Http1AsyncReceiver. | |
| queue | back to summary |
|---|---|
| private final ConcurrentLinkedDeque<ByteBuffer> queue | |
| received | back to summary |
|---|---|
| private final AtomicLong received | |
| retry | back to summary |
|---|---|
| private boolean retry | |
| scheduler | back to summary |
|---|---|
| private final SequentialScheduler scheduler | |
| stopRequested | back to summary |
|---|---|
| private volatile boolean stopRequested | |
| subscriber | back to summary |
|---|---|
| private final Http1AsyncReceiver. | |
| whenFinished | back to summary |
|---|---|
| pack-priv final MinimalFuture<Void> whenFinished | |
| Http1AsyncReceiver | back to summary |
|---|---|
| public Http1AsyncReceiver(Executor executor, Http1Exchange<?> owner) | |
| asyncReceive | back to summary |
|---|---|
| private void asyncReceive(ByteBuffer buf) | |
| checkForErrors | back to summary |
|---|---|
| private void checkForErrors() Must be called from within the scheduler main loop. Handles any pending errors by calling delegate.onReadError(). If the error can be forwarded to the delegate, stops the scheduler. | |
| checkRequestMore | back to summary |
|---|---|
| private void checkRequestMore() Must be called from within the scheduler main loop. Figure out whether more data should be requested from the Http1TubeSubscriber. | |
| clear | back to summary |
|---|---|
| pack-priv void clear() | |
| dbgString | back to summary |
|---|---|
| pack-priv String dbgString() | |
| debugQBB | back to summary |
|---|---|
| private String debugQBB(ByteBuffer[] qbb) | |
| describe | back to summary |
|---|---|
| private String describe() | |
| drain | back to summary |
|---|---|
| pack-priv ByteBuffer drain(ByteBuffer initial) | |
| flush | back to summary |
|---|---|
| private void flush() | |
| handlePendingDelegate | back to summary |
|---|---|
| private boolean handlePendingDelegate() Must be called from within the scheduler main loop. Handles pending delegate subscription. Return true if there was some pending delegate subscription and a new delegate was subscribed, false otherwise.
| |
| hasDemand | back to summary |
|---|---|
| private boolean hasDemand(Http1AsyncReceiver. Must be called from within the scheduler main loop. Return true if the delegate is not null and has some demand.
| |
| onReadError | back to summary |
|---|---|
| pack-priv void onReadError(Throwable ex) | |
| remaining | back to summary |
|---|---|
| pack-priv long remaining() | |
| setRetryOnError | back to summary |
|---|---|
| pack-priv synchronized void setRetryOnError(boolean retry) | |
| stop | back to summary |
|---|---|
| pack-priv void stop() | |
| subscribe | back to summary |
|---|---|
| pack-priv void subscribe(Http1AsyncReceiver. | |
| subscriber | back to summary |
|---|---|
| pack-priv FlowTube. Returns the TubeSubscriber for reading from the connection flow.
| |
| unsubscribe | back to summary |
|---|---|
| pack-priv void unsubscribe(Http1AsyncReceiver. | |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | onSubscribe(AbstractSubscription
A subscription that allows the delegate to control the
data flow. s)Must be called before any other method on the delegate. |
| public AbstractSubscription | Returns: the subscription that was passed toonSubscribe..Returns the subscription that was passed to |
| public boolean | Returns: false, if the byte buffer reference should be kept in the queue. Usually, this means that either the byte buffer reference was handled and parsing is finished, or that the receiver didn't handle the byte reference at all. There may or may not be any remaining data in the byte buffer, and the byte buffer reference must not have been cleared. true, if the byte buffer reference was fully read and more data can be received.A byte buffer reference coming from upstream. ref)Receives and handles a byte buffer reference. |
| close | back to summary |
|---|---|
| public void close(Throwable error) Called to make sure resources are released when the Http1AsyncReceiver is stopped.
| |
| onReadError | back to summary |
|---|---|
| public void onReadError(Throwable ex) Called when an exception is raised.
| |
| onSubscribe | back to summary |
|---|---|
| public void onSubscribe(AbstractSubscription s) Must be called before any other method on the delegate.
The subscription can be either used directly by the delegate
to request more data (e.g. if the delegate is a header parser),
or can be forwarded to a downstream subscriber (if the delegate
is a body parser that wraps a response BodySubscriber).
In all cases, it is the responsibility of the delegate to ensure
that request(n) and demand.tryDecrement() are called appropriately.
No data will be sent to
| |
| subscription | back to summary |
|---|---|
| public AbstractSubscription subscription() Returns the subscription that was passed to
| |
| tryAsyncReceive | back to summary |
|---|---|
| public boolean tryAsyncReceive(ByteBuffer ref) Receives and handles a byte buffer reference.
| |
| Modifier and Type | Field and Description |
|---|---|
| private volatile boolean | |
| private final Runnable | |
| private final Consumer | |
| private final SequentialScheduler |
| Access | Constructor and Description |
|---|---|
| pack-priv | Http1AsyncDelegateSubscription(SequentialScheduler scheduler, Runnable onCancel, Consumer<Throwable> onError)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | cancel()
Implements java. Causes the Subscriber to (eventually) stop receiving messages. |
| public void | request(long n)
Implements java. Adds the given number |
| cancelled | back to summary |
|---|---|
| private volatile boolean cancelled | |
| onCancel | back to summary |
|---|---|
| private final Runnable onCancel | |
| onError | back to summary |
|---|---|
| private final Consumer<Throwable> onError | |
| scheduler | back to summary |
|---|---|
| private final SequentialScheduler scheduler | |
| Http1AsyncDelegateSubscription | back to summary |
|---|---|
| pack-priv Http1AsyncDelegateSubscription(SequentialScheduler scheduler, Runnable onCancel, Consumer<Throwable> onError) | |
| 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
| |
| request | back to summary |
|---|---|
| public void request(long n) Implements java. Doc from java. Adds the given number
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv volatile boolean | |
| pack-priv volatile boolean | |
| pack-priv volatile 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 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> item)
Implements java. Method invoked with a Subscription's next item. |
| public void | onSubscribe(Flow.
Implements java. Method invoked prior to invoking any other Subscriber methods for the given Subscription. |
| pack-priv void |
| completed | back to summary |
|---|---|
| pack-priv volatile boolean completed | |
| dropped | back to summary |
|---|---|
| pack-priv volatile boolean dropped | |
| subscription | back to summary |
|---|---|
| pack-priv volatile Flow. | |
| Http1TubeSubscriber | back to summary |
|---|---|
| pack-priv Http1TubeSubscriber() | |
| 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 | |
| requestMore | back to summary |
|---|---|
| pack-priv void requestMore() | |