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

io.femo.http.drivers.AsynchronousExecutorHttpRequest Maven / Gradle / Ivy

Go to download

An easy to use HTTP API, that supports synchronous and asynchronous execution of HTTP request. On android only asynchronous driver is supported. This library has been backported to jdk 7 to retain compatibility with android!

The newest version!
package io.femo.http.drivers;

import io.femo.http.HttpRequest;
import io.femo.http.HttpResponseCallback;

import java.net.URL;
import java.util.concurrent.ExecutorService;

/**
 * Created by felix on 2/9/16.
 */
public class AsynchronousExecutorHttpRequest extends AsynchronousHttpRequest {

    private ExecutorService executorService;

    public AsynchronousExecutorHttpRequest(URL url, ExecutorService executorService) {
        super(url);
        this.executorService = executorService;
    }

    @Override
    public HttpRequest execute(HttpResponseCallback callback) {
        executorService.submit(getRunnable(callback));
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy