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

io.vtom.vertx.pipeline.component.timer.VtmTimerSubmit Maven / Gradle / Ivy

There is a newer version: 1.1-beta
Show newest version
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 VtmTimerSubmit extends AbstractTimer {

  private long delay;
  private Handler handler;

  public VtmTimerSubmit(Handler handler) {
    this.handler = handler;
  }

  public VtmTimerSubmit delay(long delay) {
    this.delay = delay;
    return this;
  }

  @Override
  public StepOUT out() {
    return new VtmTimerOut(stepskips()) {
      @Override
      public void execute(Vertx vertx, Handler> _handler) {
        long id = vertx.setTimer(delay, handler);
        _handler.handle(Future.succeededFuture(id));
      }
    };
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy