SyncClient

trait SyncClient extends RPCSyncClientBase with AutoCloseable

A standard blocking http client interface

trait AutoCloseable
class Object
trait Matchable
class Any

Value members

Abstract methods

def send(req: Request, requestFilter: Request => Request): Response

Send an HTTP request and get the response. It will throw an exception for non-successful responses. For example, when receiving non-retryable status code (e.g., 4xx), it will throw HttpClientException. For server side failures (5xx responses), this continues request retry until the max retry count.

Send an HTTP request and get the response. It will throw an exception for non-successful responses. For example, when receiving non-retryable status code (e.g., 4xx), it will throw 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, HttpClientMaxRetryException will be thrown.

Throws:
HttpClientException

for non-retryable error is occurred

HttpClientMaxRetryException

if max retry reaches

Concrete methods

def callInternal[Req, Resp](req: Request, requestSurface: Surface, responseSurface: Surface, requestContent: Req, requestFilter: Request => Request): Resp
def readAsInternal[Resp](req: Request, responseSurface: Surface, requestFilter: Request => Request): Resp
def sendRPC[Req](resourcePath: String, requestSurface: Surface, requestContent: Req, responseSurface: Surface, requestFilter: Request => Request): Any

Send an RPC request (POST) and return the RPC response. This method will throw RPCException when an error happens

Send an RPC request (POST) and return the RPC response. This method will throw RPCException when an error happens

Type parameters:
Req

request type

Returns:

response

def sendSafe(req: Request, requestFilter: Request => Request): Response

Send an HTTP request and returns a response (or the last response if the request is retried). Unlike send, this method returns a regular Http Response object even for non-retryable responses (e.g., 4xx error code). For retryable responses (e.g., 5xx) this continues retry until the max retry count.

Send an HTTP request and returns a response (or the last response if the request is retried). Unlike send, this method returns a regular Http Response object even for non-retryable responses (e.g., 4xx error code). For retryable responses (e.g., 5xx) this continues retry until the max retry count.

After reaching the max retry count, it will return a the last response even for 5xx status code.

Inherited methods

inline def call[Req, Resp](req: Request, requestContent: Req, requestFilter: Request => Request): Resp
Inherited from:
RPCSyncClientBase
@throws(java.lang.Exception)
def close(): Unit
Inherited from:
AutoCloseable
inline def readAs[Resp](req: Request, requestFilter: Request => Request): Resp

Read the response as a specified type

Read the response as a specified type

Returns:

a response translated to the specified type

Throws:
HttpClientException

if failed to read or process the response

Inherited from:
RPCSyncClientBase
inline def rpc[RequestType, ResponseType](resourcePath: String, request: RequestType, requestFilter: Request => Request): ResponseType
Inherited from:
RPCSyncClientBase