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:
HttpExporter
,HttpExporterBuilder
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
HttpSender.Response
The HTTP response.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
send(Marshaler marshaler, int contentLength, java.util.function.Consumer<HttpSender.Response> onResponse, java.util.function.Consumer<java.lang.Throwable> onError)
Send an HTTP request, including any retry attempts.CompletableResultCode
shutdown()
Shutdown the sender.
-
-
-
Method Detail
-
send
void send(Marshaler marshaler, int contentLength, java.util.function.Consumer<HttpSender.Response> onResponse, java.util.function.Consumer<java.lang.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.
-
-