com.king.platform.net.http.BaseBuiltClientRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of king-http-client Show documentation
Show all versions of king-http-client Show documentation
A asyncronous http client built ontop of netty.
package com.king.platform.net.http;
import java.util.concurrent.CompletableFuture;
import java.util.function.Supplier;
public interface BaseBuiltClientRequest> {
/**
* Execute the built request, consume the returned data as T.
* T is determined by the defined {@link ResponseBodyConsumer}
*
* @return a future with the result of the request
*/
CompletableFuture> execute();
/**
* Specific httpCallback that will be executed for all requests
* HttpCallbacks are executed on the HttpCallbackExecutor
* If the intention is to reuse this built request, make sure to use {@link #withHttpCallback(Supplier)} instead.
*
* @param httpCallback httpCallback the callback object
* @return this builder
*/
B withHttpCallback(HttpCallback httpCallback);
/**
* Each execution will use a HttpCallback supplied from the supplier.
* HttpCallbacks are executed on the HttpCallbackExecutor
*
* @param httpCallbackSupplier the supplier of httpCallbacks
* @return this builder
*/
B withHttpCallback(Supplier> httpCallbackSupplier);
/**
* Specific nioCallback that will be executed for all requests.
* NioCallbacks are executed on the nio threads. Make sure to not do any blocking!.
* If the intention is to reuse this built request, make sure to use {@link #withNioCallback(Supplier)} instead.
* @param nioCallback the nio callback
* @return this builder
*/
B withNioCallback(NioCallback nioCallback);
/**
* Each execution will use a NioCallback supplied from the supplier
* NioCallbacks are executed on the nio threads. Make sure to not do any blocking!.
* @param nioCallbackSupplier the supplier of nio callback
* @return this builder
*/
B withNioCallback(Supplier nioCallbackSupplier);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy