io.vtom.vertx.pipeline.component.timer.VtmTimerCancel Maven / Gradle / Ivy
package io.vtom.vertx.pipeline.component.timer;
import io.vertx.core.AsyncResult;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vtom.vertx.pipeline.step.StepOUT;
public class VtmTimerCancel extends AbstractTimer {
private long id;
public VtmTimerCancel(long id) {
this.id = id;
}
@Override
public StepOUT out() {
return new VtmTimerOut(stepskips()) {
@Override
public void execute(Vertx vertx, Handler> handler) {
boolean ok = vertx.cancelTimer(id);
handler.handle(Future.succeededFuture(ok));
}
};
}
}