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

cn.buli_home.utils.net.http.HttpCallback Maven / Gradle / Ivy

package cn.buli_home.utils.net.http;

import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;
import org.jetbrains.annotations.NotNull;

import java.io.IOException;
import java.util.concurrent.CompletableFuture;

/**
 * HTTP 请求回调
 *
 * @author mustard
 * @version 1.0
 * Create by 2022/9/14
 */
class HttpCallback extends CompletableFuture implements Callback {

    @Override
    public void onFailure(@NotNull Call call, @NotNull IOException e) {
        super.completeExceptionally(e);
    }

    @Override
    public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
        super.complete(response);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy