Interface HttpSender
-
public interface HttpSenderAn 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 interfaceHttpSender.ResponseThe HTTP response.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidsend(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.CompletableResultCodeshutdown()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.onResponseis called with the HTTP response, either a success response or a error response after retries.onErroris 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.
-
-