
io.github.vipcxj.jasync.ng.runtime.promise.GeneralPromise Maven / Gradle / Ivy
package io.github.vipcxj.jasync.ng.runtime.promise;
import io.github.vipcxj.jasync.ng.runtime.schedule.Task;
import io.github.vipcxj.jasync.ng.spec.JContext;
public class GeneralPromise extends AbstractPromise {
protected final Task task;
public GeneralPromise(Task task, AbstractPromise> parent) {
super(parent);
this.task = task;
}
public GeneralPromise(Task task) {
this(task, null);
}
@Override
protected void run(JContext context) {
task.schedule(this, context);
}
@Override
protected void dispose() {
task.cancel();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy