All Downloads are FREE. Search and download functionalities are using the official Maven repository.

global.maplink.http.HttpAsyncEngine Maven / Gradle / Ivy

The newest version!
package global.maplink.http;

import global.maplink.NoImplementationFoundException;
import global.maplink.http.request.Request;

import java.util.ServiceLoader;
import java.util.concurrent.CompletableFuture;
import java.util.stream.StreamSupport;

public interface HttpAsyncEngine {

    CompletableFuture run(Request request);

    static HttpAsyncEngine loadDefault() {
        ServiceLoader load = ServiceLoader.load(HttpAsyncEngine.class);
        return StreamSupport.stream(load.spliterator(), false)
                .findFirst()
                .orElseThrow(() -> new NoImplementationFoundException(HttpAsyncEngine.class));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy