@Deprecated public class DefaultHttpRequest extends DefaultStreamMessage<HttpObject> implements HttpRequestWriter
HttpRequest implementation.| Constructor and Description |
|---|
DefaultHttpRequest(RequestHeaders headers)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
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. |
RequestHeaders |
headers()
Deprecated.
Returns the initial HTTP/2 headers of this request.
|
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. |
String |
toString()
Deprecated.
|
boolean |
tryWrite(T obj)
Writes the specified object to the
StreamMessage. |
CompletableFuture<Void> |
whenComplete()
Returns a
CompletableFuture that completes when this stream is complete,
either successfully or exceptionally, including cancellation and abortion. |
CompletableFuture<Void> |
whenConsumed()
Returns a
CompletableFuture which is completed when all elements written so far have been
consumed by the Subscriber. |
abort, abort, close, close, isEmpty, isOpen, tryCloseclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaggregate, aggregate, aggregateWithPooledObjects, aggregateWithPooledObjects, authority, contentType, method, of, of, of, of, of, of, of, of, of, of, of, of, of, of, path, scheme, streaming, streaming, toDuplicator, toDuplicator, toDuplicator, toDuplicator, uri, withHeaders, withHeadersabort, abort, closeFuture, completionFuture, defaultSubscriberExecutor, drainAll, drainAll, drainAll, drainAll, isComplete, isEmpty, isOpen, of, subscribe, subscribe, subscribe, subscribe, whenComplete@Deprecated public DefaultHttpRequest(RequestHeaders headers)
HttpRequest.streaming(RequestHeaders).public RequestHeaders headers()
HttpRequestheaders in interface HttpRequestpublic 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> whenConsumed()
StreamWriterCompletableFuture which is completed when all elements written so far have been
consumed by the Subscriber.StreamMessage has been closed unexpectedly.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.