@Deprecated public class DefaultHttpResponse extends DefaultStreamMessage<HttpObject> implements HttpResponseWriter
HttpResponse instance.| Constructor and Description |
|---|
DefaultHttpResponse()
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()
Returns the default
EventExecutor which will be used when a user subscribes using
subscribe(Subscriber) or subscribe(Subscriber, SubscriptionOption...). |
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. |
CompletableFuture<Void> |
onDemand(Runnable task)
Performs the specified
task when there are enough demands from the Subscriber. |
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. |
String |
toString()
Deprecated.
|
boolean |
tryWrite(T obj)
Writes the specified object to the
StreamMessage. |
abort, abort, close, close, isEmpty, isOpen, tryCloseclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclose, respond, respond, respond, respond, respond, respond, respondaggregate, 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 boolean tryWrite(T obj)
StreamWriterStreamMessage. The written object will be transferred to the
Subscriber.true if the specified object has been scheduled for publication. false if the
stream has been closed already.public CompletableFuture<Void> onDemand(Runnable task)
StreamWritertask when there are enough demands from the Subscriber.task finishes or
exceptionally when the StreamMessage is closed unexpectedly.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 withprotected io.netty.util.concurrent.EventExecutor defaultSubscriberExecutor()
EventExecutor which will be used when a user subscribes using
subscribe(Subscriber) or subscribe(Subscriber, SubscriptionOption...).public 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.