Interface HttpSender
public interface HttpSender
An abstraction for sending HTTP requests and handling responses.
This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
- See Also:
-
Method Details
-
send
void send(Marshaler marshaler, int contentLength, Consumer<HttpSender.Response> onResponse, Consumer<Throwable> onError) Send an HTTP request, including any retry attempts.onResponse
is called with the HTTP response, either a success response or a error response after retries.onError
is called when the request could not be executed due to cancellation, connectivity problems, or timeout.- Parameters:
marshaler
- the request body marshalercontentLength
- the request body content lengthonResponse
- the callback to invoke with the HTTP responseonError
- the callback to invoke when the HTTP request could not be executed
-
shutdown
CompletableResultCode shutdown()Shutdown the sender.
-