@Deprecated public class DeferredHttpResponse extends DeferredStreamMessage<HttpObject> implements HttpResponse
HttpResponse whose stream is published later by another HttpResponse. It is used when
an HttpResponse will not be instantiated early.| Constructor and Description |
|---|
DeferredHttpResponse()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
completionFuture()
Returns a
CompletableFuture that completes when this stream is complete,
either successfully or exceptionally, including cancellation and abortion. |
protected io.netty.util.concurrent.EventExecutor |
defaultSubscriberExecutor()
Deprecated.
Returns the default
EventExecutor which will be used when a user subscribes using
subscribe(Subscriber) or subscribe(Subscriber, SubscriptionOption...). |
void |
delegate(HttpResponse delegate)
Deprecated.
Sets the delegate
HttpResponse which will publish the stream actually. |
CompletableFuture<List<T>> |
drainAll()
Subscribes to this
StreamMessage and retrieves all elements from it. |
CompletableFuture<List<T>> |
drainAll(boolean withPooledObjects)
Subscribes to this
StreamMessage and retrieves all elements from it. |
CompletableFuture<List<T>> |
drainAll(io.netty.util.concurrent.EventExecutor executor)
Subscribes to this
StreamMessage and retrieves all elements from it. |
CompletableFuture<List<T>> |
drainAll(io.netty.util.concurrent.EventExecutor executor,
boolean withPooledObjects)
Subscribes to this
StreamMessage and retrieves all elements from it. |
CompletableFuture<List<T>> |
drainAll(io.netty.util.concurrent.EventExecutor executor,
SubscriptionOption... options)
Subscribes to this
StreamMessage and retrieves all elements from it. |
CompletableFuture<List<T>> |
drainAll(SubscriptionOption... options)
Subscribes to this
StreamMessage and retrieves all elements from it. |
protected void |
onRemoval(T obj)
Invoked after an element is removed from the
StreamMessage and before
Subscriber.onNext(Object) is invoked. |
void |
subscribe(org.reactivestreams.Subscriber<? super T> subscriber)
Requests to start streaming data to the specified
Subscriber. |
void |
subscribe(org.reactivestreams.Subscriber<? super T> subscriber,
boolean withPooledObjects)
Requests to start streaming data to the specified
Subscriber. |
void |
subscribe(org.reactivestreams.Subscriber<? super T> subscriber,
io.netty.util.concurrent.EventExecutor executor)
Requests to start streaming data to the specified
Subscriber. |
void |
subscribe(org.reactivestreams.Subscriber<? super T> subscriber,
io.netty.util.concurrent.EventExecutor executor,
boolean withPooledObjects)
Requests to start streaming data, invoking the specified
Subscriber from the specified
Executor. |
void |
subscribe(org.reactivestreams.Subscriber<? super T> subscriber,
io.netty.util.concurrent.EventExecutor executor,
SubscriptionOption... options)
Requests to start streaming data to the specified
Subscriber. |
void |
subscribe(org.reactivestreams.Subscriber<? super T> subscriber,
SubscriptionOption... options)
Requests to start streaming data to the specified
Subscriber. |
abort, abort, close, close, delegate, isEmpty, isOpenclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaggregate, aggregate, aggregateWithPooledObjects, aggregateWithPooledObjects, closeFuture, completionFuture, delayed, delayed, delayed, delayed, from, from, of, of, of, of, of, of, of, of, of, of, of, of, of, of, of, of, of, of, ofFailed, ofFailure, streamingpublic void delegate(HttpResponse delegate)
HttpResponse which will publish the stream actually.IllegalStateException - if the delegate has been set already or
if DeferredStreamMessage.close() or DeferredStreamMessage.close(Throwable) was called already.protected io.netty.util.concurrent.EventExecutor defaultSubscriberExecutor()
EventExecutor which will be used when a user subscribes using
subscribe(Subscriber) or subscribe(Subscriber, SubscriptionOption...).public final void subscribe(org.reactivestreams.Subscriber<? super T> subscriber)
StreamMessageSubscriber. If there is a problem subscribing,
Subscriber.onError(Throwable) will be invoked with one of the following exceptions:
IllegalStateException if other Subscriber subscribed to this stream already.AbortedStreamException if this stream has been aborted.CancelledSubscriptionException if this stream has been
cancelled and SubscriptionOption.NOTIFY_CANCELLATION is
specified when subscribed.subscribe in interface StreamMessage<T>subscribe in interface org.reactivestreams.Publisher<T>public final void subscribe(org.reactivestreams.Subscriber<? super T> subscriber,
boolean withPooledObjects)
StreamMessageSubscriber. If there is a problem subscribing,
Subscriber.onError(Throwable) will be invoked with one of the following exceptions:
IllegalStateException if other Subscriber subscribed to this stream already.AbortedStreamException if this stream has been aborted.CancelledSubscriptionException if this stream has been
cancelled and SubscriptionOption.NOTIFY_CANCELLATION is
specified when subscribed.subscribe in interface StreamMessage<T>public final void subscribe(org.reactivestreams.Subscriber<? super T> subscriber,
SubscriptionOption... options)
StreamMessageSubscriber. If there is a problem subscribing,
Subscriber.onError(Throwable) will be invoked with one of the following exceptions:
IllegalStateException if other Subscriber subscribed to this stream already.AbortedStreamException if this stream has been aborted.CancelledSubscriptionException if this stream has been
cancelled and SubscriptionOption.NOTIFY_CANCELLATION is
specified when subscribed.subscribe in interface StreamMessage<T>options - SubscriptionOptions to subscribe withpublic final void subscribe(org.reactivestreams.Subscriber<? super T> subscriber,
io.netty.util.concurrent.EventExecutor executor,
boolean withPooledObjects)
StreamMessageSubscriber from the specified
Executor. If there is a problem subscribing, Subscriber.onError(Throwable) will be
invoked with one of the following exceptions:
IllegalStateException if other Subscriber subscribed to this stream already.AbortedStreamException if this stream has been aborted.CancelledSubscriptionException if this stream has been
cancelled and SubscriptionOption.NOTIFY_CANCELLATION is
specified when subscribed.subscribe in interface StreamMessage<T>executor - the executor to subscribepublic final void subscribe(org.reactivestreams.Subscriber<? super T> subscriber,
io.netty.util.concurrent.EventExecutor executor)
StreamMessageSubscriber. If there is a problem subscribing,
Subscriber.onError(Throwable) will be invoked with one of the following exceptions:
IllegalStateException if other Subscriber subscribed to this stream already.AbortedStreamException if this stream has been aborted.CancelledSubscriptionException if this stream has been
cancelled and SubscriptionOption.NOTIFY_CANCELLATION is
specified when subscribed.subscribe in interface StreamMessage<T>executor - the executor to subscribepublic final void subscribe(org.reactivestreams.Subscriber<? super T> subscriber,
io.netty.util.concurrent.EventExecutor executor,
SubscriptionOption... options)
StreamMessageSubscriber. If there is a problem subscribing,
Subscriber.onError(Throwable) will be invoked with one of the following exceptions:
IllegalStateException if other Subscriber subscribed to this stream already.AbortedStreamException if this stream has been aborted.CancelledSubscriptionException if this stream has been
cancelled and SubscriptionOption.NOTIFY_CANCELLATION is
specified when subscribed.subscribe in interface StreamMessage<T>executor - the executor to subscribeoptions - SubscriptionOptions to subscribe withpublic final CompletableFuture<List<T>> drainAll()
StreamMessageStreamMessage and retrieves all elements from it.
The returned CompletableFuture may be completed exceptionally with the following exceptions:
IllegalStateException if other Subscriber subscribed to this stream already.AbortedStreamException if this stream has been aborted.drainAll in interface StreamMessage<T>CompletableFuture which will be completed with the list of the elements retrieved.public final CompletableFuture<List<T>> drainAll(boolean withPooledObjects)
StreamMessageStreamMessage and retrieves all elements from it.
The returned CompletableFuture may be completed exceptionally with the following exceptions:
IllegalStateException if other Subscriber subscribed to this stream already.AbortedStreamException if this stream has been aborted.drainAll in interface StreamMessage<T>CompletableFuture which will be completed with the list of the elements retrieved.public final CompletableFuture<List<T>> drainAll(SubscriptionOption... options)
StreamMessageStreamMessage and retrieves all elements from it.
The returned CompletableFuture may be completed exceptionally with the following exceptions:
IllegalStateException if other Subscriber subscribed to this stream already.AbortedStreamException if this stream has been aborted.drainAll in interface StreamMessage<T>options - SubscriptionOptions to subscribe with. Note that
SubscriptionOption.NOTIFY_CANCELLATION is ineffective because there's no
cancelling while draining all elements.CompletableFuture which will be completed with the list of the elements retrieved.public final CompletableFuture<List<T>> drainAll(io.netty.util.concurrent.EventExecutor executor, boolean withPooledObjects)
StreamMessageStreamMessage and retrieves all elements from it.
The returned CompletableFuture may be completed exceptionally with the following exceptions:
IllegalStateException if other Subscriber subscribed to this stream already.AbortedStreamException if this stream has been aborted.drainAll in interface StreamMessage<T>executor - the executor to retrieve all elementsCompletableFuture which will be completed with the list of the elements retrieved.public final CompletableFuture<List<T>> drainAll(io.netty.util.concurrent.EventExecutor executor)
StreamMessageStreamMessage and retrieves all elements from it.
The returned CompletableFuture may be completed exceptionally with the following exceptions:
IllegalStateException if other Subscriber subscribed to this stream already.AbortedStreamException if this stream has been aborted.drainAll in interface StreamMessage<T>executor - the executor to retrieve all elementsCompletableFuture which will be completed with the list of the elements retrieved.public final CompletableFuture<List<T>> drainAll(io.netty.util.concurrent.EventExecutor executor, SubscriptionOption... options)
StreamMessageStreamMessage and retrieves all elements from it.
The returned CompletableFuture may be completed exceptionally with the following exceptions:
IllegalStateException if other Subscriber subscribed to this stream already.AbortedStreamException if this stream has been aborted.drainAll in interface StreamMessage<T>executor - the executor to retrieve all elementsoptions - SubscriptionOptions to subscribe with. Note that
SubscriptionOption.NOTIFY_CANCELLATION is ineffective because there's no
cancelling while draining all elements.CompletableFuture which will be completed with the list of the elements retrieved.public final CompletableFuture<Void> completionFuture()
StreamMessageCompletableFuture that completes when this stream is complete,
either successfully or exceptionally, including cancellation and abortion.
A StreamMessage is complete
(or 'fully consumed') when:
Subscriber consumes all elements and Subscriber.onComplete() is invoked,Subscriber.onError(Throwable) is invoked,Subscription has been cancelled orStreamMessage.abort() has been requested.completionFuture in interface StreamMessage<T>protected void onRemoval(T obj)
StreamMessage and before
Subscriber.onNext(Object) is invoked.obj - the removed elementCopyright © 2020 LeanCloud. All rights reserved.