com.taobao.drc.clusterclient.util.Futures Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of consumer-core Show documentation
Show all versions of consumer-core Show documentation
The java consumer core component for Data Transmission Service
package com.taobao.drc.clusterclient.util;
import java.util.concurrent.Future;
/**
* @author yangyang
* @since 2017/8/7
*/
public class Futures {
public static Future success(T t) {
SettableFuture promise = new SettableFuture();
promise.success(t);
return promise;
}
public static Future failure(Throwable throwable) {
SettableFuture promise = new SettableFuture();
promise.failure(throwable);
return promise;
}
}