@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 |
|---|---|
io.netty.util.concurrent.EventExecutor |
defaultSubscriberExecutor()
Deprecated.
Returns the default
EventExecutor which will be used when a user subscribes using
StreamMessage.subscribe(Subscriber), StreamMessage.subscribe(Subscriber, SubscriptionOption...),
StreamMessage.drainAll() and StreamMessage.drainAll(SubscriptionOption...). |
void |
delegate(HttpResponse delegate)
Deprecated.
Sets the delegate
HttpResponse which will publish the stream actually. |
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,
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,
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,
SubscriptionOption... options)
Requests to start streaming data to the specified
Subscriber. |
CompletableFuture<Void> |
whenComplete()
Returns a
CompletableFuture that completes when this stream is complete,
either successfully or exceptionally, including cancellation and abortion. |
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, streaming, toDuplicator, toDuplicator, toDuplicator, toDuplicator, whenComplete@Deprecated public DeferredHttpResponse()
HttpResponse.from(CompletionStage).public 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.public io.netty.util.concurrent.EventExecutor defaultSubscriberExecutor()
StreamMessageEventExecutor which will be used when a user subscribes using
StreamMessage.subscribe(Subscriber), StreamMessage.subscribe(Subscriber, SubscriptionOption...),
StreamMessage.drainAll() and StreamMessage.drainAll(SubscriptionOption...).
Please note that if this method is called multiple times, the returned EventExecutors can be
different depending on this StreamMessage implementation.
defaultSubscriberExecutor in interface StreamMessage<HttpObject>public 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(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> whenComplete()
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.whenComplete 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.