public class DefaultRxHttpClient extends Object implements RxHttpClient
RxHttpClient interface.| Constructor and Description |
|---|
DefaultRxHttpClient(AsyncHttpClient asyncHttpClient)
Returns a new
DefaultRxHttpClient instance that uses the given asyncHttpClient under the hoods. |
| Modifier and Type | Method and Description |
|---|---|
protected <T> AsyncHandler<?> |
createBridge(io.reactivex.MaybeEmitter<T> emitter,
AsyncHandler<T> handler)
Creates an
AsyncHandler that bridges events from the given handler to the given emitter
and cancellation/disposal in the other direction. |
<T> io.reactivex.Maybe<T> |
prepare(Request request,
java.util.function.Supplier<? extends AsyncHandler<T>> handlerSupplier)
Prepares the given
request. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, preparepublic DefaultRxHttpClient(AsyncHttpClient asyncHttpClient)
DefaultRxHttpClient instance that uses the given asyncHttpClient under the hoods.asyncHttpClient - the Async HTTP Client instance to be usedNullPointerException - if asyncHttpClient is nullpublic <T> io.reactivex.Maybe<T> prepare(Request request, java.util.function.Supplier<? extends AsyncHandler<T>> handlerSupplier)
RxHttpClientrequest. For each subscription to the returned Maybe, a new HTTP request will
be executed and the results of AsyncHandlers obtained from handlerSupplier will be emitted.prepare in interface RxHttpClientT - the result type produced by handlers produced by handlerSupplier and emitted by the returned
Maybe instancerequest - the request that is to be executedhandlerSupplier - supplies the desired AsyncHandler instances that are used to produce resultsMaybe that executes request upon subscription and that emits the results produced by
the supplied handersprotected <T> AsyncHandler<?> createBridge(io.reactivex.MaybeEmitter<T> emitter, AsyncHandler<T> handler)
AsyncHandler that bridges events from the given handler to the given emitter
and cancellation/disposal in the other direction.T - the result type produced by handler and emitted by emitteremitter - the RxJava emitter instance that receives results upon completion and will be queried for disposal
during event processinghandler - the AsyncHandler instance that receives downstream events and produces the result that will be
emitted upon request completionCopyright © 2017. All Rights Reserved.