public static final class HttpLoadBalancerFactory.DefaultFilterableStreamingHttpLoadBalancedConnection extends Object implements FilterableStreamingHttpLoadBalancedConnection
FilterableStreamingHttpLoadBalancedConnection.| Constructor and Description |
|---|
DefaultFilterableStreamingHttpLoadBalancedConnection(FilterableStreamingHttpConnection delegate,
ReservableRequestConcurrencyController controller)
Create a new instance without support for
score(). |
DefaultFilterableStreamingHttpLoadBalancedConnection(FilterableStreamingHttpConnection delegate,
ReservableRequestConcurrencyController controller,
ScoreSupplier scoreSupplier)
Create a new instance.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclose, closeGracefullypublic DefaultFilterableStreamingHttpLoadBalancedConnection(FilterableStreamingHttpConnection delegate, ReservableRequestConcurrencyController controller)
score().delegate - FilterableStreamingHttpConnection to delegate tocontroller - ReservableRequestConcurrencyController to control concurrent access to the delegatepublic DefaultFilterableStreamingHttpLoadBalancedConnection(FilterableStreamingHttpConnection delegate, ReservableRequestConcurrencyController controller, ScoreSupplier scoreSupplier)
delegate - FilterableStreamingHttpConnection to delegate tocontroller - ReservableRequestConcurrencyController to control concurrent access to the delegatescoreSupplier - ScoreSupplier to query the score()public int score()
score in interface ScoreSupplierpublic HttpConnectionContext connectionContext()
FilterableStreamingHttpConnectionHttpConnectionContext.connectionContext in interface FilterableStreamingHttpConnectionHttpConnectionContext.public <T> Publisher<? extends T> transportEventStream(HttpEventKey<T> eventKey)
FilterableStreamingHttpConnectionPublisher that gives the current value of a transport event as well as subsequent changes to
the event value as long as the PublisherSource.Subscriber has expressed enough demand.
This is designed for events produced by the transport, and consumed by filters interested in transport behavior which is not directly involved in the data path.
transportEventStream in interface FilterableStreamingHttpConnectionT - Type of the event value.eventKey - Name of the event to fetch.Publisher for the event values.public Single<StreamingHttpResponse> request(StreamingHttpRequest request)
StreamingHttpRequesterrequest.request in interface StreamingHttpRequesterrequest - the request to send.public HttpExecutionContext executionContext()
StreamingHttpRequesterHttpExecutionContext used during construction of this object.
Note that the ExecutionContext.ioExecutor() will not necessarily be associated with a specific thread
unless that was how this object was built.
executionContext in interface StreamingHttpRequesterHttpExecutionContext used during construction of this object.public StreamingHttpResponseFactory httpResponseFactory()
StreamingHttpRequesterStreamingHttpResponseFactory.httpResponseFactory in interface StreamingHttpRequesterStreamingHttpResponseFactory.public Completable onClose()
onClose in interface ListenableAsyncCloseablepublic Completable onClosing()
onClosing in interface ListenableAsyncCloseablepublic Completable closeAsync()
closeAsync in interface AsyncCloseablepublic Completable closeAsyncGracefully()
closeAsyncGracefully in interface AsyncCloseablepublic StreamingHttpRequest newRequest(HttpRequestMethod method, String requestTarget)
StreamingHttpRequestFactoryHttpRequestFactory.newRequest in interface StreamingHttpRequestFactorymethod - The HttpRequestMethod.requestTarget - The request target.HttpRequestFactory.public RequestConcurrencyController.Result tryRequest()
tryRequest in interface LoadBalancedConnectiontryRequest in interface RequestConcurrencyControllerpublic void requestFinished()
requestFinished in interface LoadBalancedConnectionrequestFinished in interface RequestConcurrencyControllerpublic boolean tryReserve()
tryReserve in interface LoadBalancedConnectiontryReserve in interface ReservableRequestConcurrencyControllerpublic Completable releaseAsync()
FilterableReservedStreamingHttpConnectionFilterableStreamingHttpConnection to be used for subsequent requests.
This method must be idempotent, i.e. calling multiple times must not have side-effects.releaseAsync in interface LoadBalancedConnectionreleaseAsync in interface ReservableRequestConcurrencyControllerreleaseAsync in interface FilterableReservedStreamingHttpConnectionreleaseAsync in interface FilterableStreamingHttpLoadBalancedConnectionCompletable that is notified on releaseAsync.public ReservedHttpConnection asConnection()
StreamingHttpConnectionStreamingHttpConnection to the HttpConnection API.
This API is provided for convenience. It is recommended that
filters are implemented using the StreamingHttpConnection asynchronous API for maximum portability.
asConnection in interface FilterableStreamingHttpLoadBalancedConnectionasConnection in interface ReservedStreamingHttpConnectionasConnection in interface StreamingHttpConnectionHttpConnection representation of this StreamingHttpConnection.public ReservedBlockingStreamingHttpConnection asBlockingStreamingConnection()
StreamingHttpConnectionStreamingHttpConnection to the BlockingStreamingHttpConnection API.
This API is provided for convenience for a more familiar sequential programming model. It is recommended that
filters are implemented using the StreamingHttpConnection asynchronous API for maximum portability.
asBlockingStreamingConnection in interface FilterableStreamingHttpLoadBalancedConnectionasBlockingStreamingConnection in interface ReservedStreamingHttpConnectionasBlockingStreamingConnection in interface StreamingHttpConnectionBlockingStreamingHttpConnection representation of this StreamingHttpConnection.public ReservedBlockingHttpConnection asBlockingConnection()
StreamingHttpConnectionStreamingHttpConnection to the BlockingHttpConnection API.
This API is provided for convenience for a more familiar sequential programming model. It is recommended that
filters are implemented using the StreamingHttpConnection asynchronous API for maximum portability.
asBlockingConnection in interface FilterableStreamingHttpLoadBalancedConnectionasBlockingConnection in interface ReservedStreamingHttpConnectionasBlockingConnection in interface StreamingHttpConnectionBlockingHttpConnection representation of this StreamingHttpConnection.public String toString()
toString in class Object