AsyncClient

wvlet.airframe.http.client.AsyncClient
trait AsyncClient extends AsyncClientCompat, HttpClientFactory[AsyncClient], AutoCloseable, LogSupport

A standard async http client interface for Rx[_]

Attributes

Graph
Supertypes
trait LogSupport
trait LazyLogger
trait LoggingMethods
trait Serializable
trait AutoCloseable
class Object
trait Matchable
class Any
Show all
Known subtypes

Members list

Value members

Abstract methods

protected def channel: HttpChannel

Concrete methods

def callInternal[Req, Resp](req: Request, requestSurface: Surface, responseSurface: Surface, requestContent: Req): Rx[Resp]
override def close(): Unit

Attributes

Definition Classes
AutoCloseable
def readAsInternal[Resp](req: Request, responseSurface: Surface): Rx[Resp]
def rpc[Req, Resp](method: RPCMethod, requestContent: Req): Rx[Resp]

Attributes

Returns

Rx of the response. If the RPC request fails, Rx[RPCException] will be returned.

def send(req: Request, context: HttpClientContext): Rx[Response]

Send an HTTP request and get the response in Rx[Response] type.

Send an HTTP request and get the response in Rx[Response] type.

It will return Rx[HttpClientException] for non-successful responses. For example, when receiving non-retryable status code (e.g., 4xx), it will return Rx[HttpClientException]. For server side failures (5xx responses), this continues request retry until the max retry count.

If it exceeds the number of max retry attempts, it will return Rx[HttpClientMaxRetryException].

Attributes

def sendSafe(req: Request, context: HttpClientContext): Rx[Response]

Send an HTTP request and returns a response (or the last response if the request is retried)

Send an HTTP request and returns a response (or the last response if the request is retried)

Attributes

Inherited methods

protected def build(newConfig: HttpClientConfig): AsyncClient

Create a new client sharing the same underlying http client

Create a new client sharing the same underlying http client

Attributes

Inherited from:
HttpClientFactory
inline def call[Req, Resp](req: Request, requestContent: Req): Rx[Resp]

Attributes

Inherited from:
AsyncClientCompat
inline protected def debug(inline message: Any, inline cause: Throwable): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def debug(inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def error(inline message: Any, inline cause: Throwable): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def error(inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def info(inline message: Any, inline cause: Throwable): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def info(inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def logAt(inline logLevel: LogLevel, inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods
inline def readAs[Resp](req: Request): Rx[Resp]

Attributes

Inherited from:
AsyncClientCompat
inline protected def trace(inline message: Any, inline cause: Throwable): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def trace(inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def warn(inline message: Any, inline cause: Throwable): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def warn(inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods
def withCircuitBreaker(filter: CircuitBreaker => CircuitBreaker): AsyncClient

Attributes

Inherited from:
HttpClientFactory

Attributes

Inherited from:
HttpClientFactory

Attributes

Inherited from:
HttpClientFactory
def withConnectTimeout(duration: Duration): AsyncClient

Attributes

Inherited from:
HttpClientFactory

Attributes

Inherited from:
HttpClientFactory
def withReadTimeout(duration: Duration): AsyncClient

Attributes

Inherited from:
HttpClientFactory
def withRequestFilter(requestFilter: Request => Request): AsyncClient

Attributes

Inherited from:
HttpClientFactory
def withResponseFilter(responseFilter: Response => Response): AsyncClient

Attributes

Inherited from:
HttpClientFactory
def withRetryContext(filter: RetryContext => RetryContext): AsyncClient

Attributes

Inherited from:
HttpClientFactory