T - the result type produced by the wrapped AsyncHandler and emitted via RxJavapublic abstract class AbstractMaybeAsyncHandlerBridge<T> extends Object implements AsyncHandler<Void>
Maybe reactive base type and AsyncHandlers.
When an event is received, it's first checked if the Rx stream has been disposed asynchronously. If so, request processing is aborted, otherwise, the event is forwarded to the wrapped handler.
When the request is completed, the result produced by the wrapped instance is
forwarded to the Maybe: If the result is null, MaybeEmitter.onComplete() is invoked,
MaybeEmitter.onSuccess(Object) otherwise.
Any errors during request processing are forwarded via MaybeEmitter.onError(Throwable).
AsyncHandler.State| Modifier and Type | Field and Description |
|---|---|
protected io.reactivex.MaybeEmitter<T> |
emitter
The Rx callback object that receives downstream events and will be queried for its
disposed state when Async HTTP Client callbacks are invoked. |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractMaybeAsyncHandlerBridge(io.reactivex.MaybeEmitter<T> emitter) |
protected final io.reactivex.MaybeEmitter<T> emitter
disposed state when Async HTTP Client callbacks are invoked.protected AbstractMaybeAsyncHandlerBridge(io.reactivex.MaybeEmitter<T> emitter)
public final AsyncHandler.State onBodyPartReceived(HttpResponseBodyPart content) throws Exception
onBodyPartReceived in interface AsyncHandler<Void>Exceptionpublic final AsyncHandler.State onStatusReceived(HttpResponseStatus status) throws Exception
onStatusReceived in interface AsyncHandler<Void>Exceptionpublic final AsyncHandler.State onHeadersReceived(io.netty.handler.codec.http.HttpHeaders headers) throws Exception
onHeadersReceived in interface AsyncHandler<Void>Exceptionpublic AsyncHandler.State onTrailingHeadersReceived(io.netty.handler.codec.http.HttpHeaders headers) throws Exception
onTrailingHeadersReceived in interface AsyncHandler<Void>Exceptionpublic final Void onCompleted()
The value returned by the wrapped AsyncHandler won't be returned by this method, but emitted via RxJava.
onCompleted in interface AsyncHandler<Void>nullpublic final void onThrowable(Throwable t)
The exception will first be propagated to the wrapped AsyncHandler, then emitted via RxJava. If the
invocation of the delegate itself throws an exception, both the original exception and the follow-up exception
will be wrapped into RxJava's CompositeException and then be emitted.
onThrowable in interface AsyncHandler<Void>public void onHostnameResolutionAttempt(String name)
onHostnameResolutionAttempt in interface AsyncHandler<Void>public void onHostnameResolutionSuccess(String name, List<InetSocketAddress> addresses)
onHostnameResolutionSuccess in interface AsyncHandler<Void>public void onHostnameResolutionFailure(String name, Throwable cause)
onHostnameResolutionFailure in interface AsyncHandler<Void>public void onTcpConnectAttempt(InetSocketAddress remoteAddress)
onTcpConnectAttempt in interface AsyncHandler<Void>public void onTcpConnectSuccess(InetSocketAddress remoteAddress, io.netty.channel.Channel connection)
onTcpConnectSuccess in interface AsyncHandler<Void>public void onTcpConnectFailure(InetSocketAddress remoteAddress, Throwable cause)
onTcpConnectFailure in interface AsyncHandler<Void>public void onTlsHandshakeAttempt()
onTlsHandshakeAttempt in interface AsyncHandler<Void>public void onTlsHandshakeSuccess(SSLSession sslSession)
onTlsHandshakeSuccess in interface AsyncHandler<Void>public void onTlsHandshakeFailure(Throwable cause)
onTlsHandshakeFailure in interface AsyncHandler<Void>public void onConnectionPoolAttempt()
onConnectionPoolAttempt in interface AsyncHandler<Void>public void onConnectionPooled(io.netty.channel.Channel connection)
onConnectionPooled in interface AsyncHandler<Void>public void onConnectionOffer(io.netty.channel.Channel connection)
onConnectionOffer in interface AsyncHandler<Void>public void onRequestSend(NettyRequest request)
onRequestSend in interface AsyncHandler<Void>public void onRetry()
onRetry in interface AsyncHandler<Void>protected final AsyncHandler.State disposed()
delegate didn't already receive a terminal event,
AsyncHandler#onThrowable(Throwable) onThrowable will be called with a DisposedException.State#ABORTprotected abstract AsyncHandler<? extends T> delegate()
AsyncHandler instance to which calls are delegatedCopyright © 2024. All rights reserved.