io.github.vipcxj.jasync.ng.spec.JHandle Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jasync-spec Show documentation
Show all versions of jasync-spec Show documentation
JAsync implements Async-Await fashion for Java just like es and c#.
This library provide the spec of all public api.
package io.github.vipcxj.jasync.ng.spec;
import java.util.List;
public interface JHandle {
boolean isResolved();
boolean isRejected();
default boolean isCompleted() {
return isResolved() || isRejected();
}
void cancel();
boolean isCanceled();
T block(JContext context) throws InterruptedException;
default T block() throws InterruptedException {
return block(JContext.defaultContext());
}
T getValue();
Throwable getError();
List getSuspendThrowables();
}