Interface WithTiming
- All Superinterfaces:
io.vertx.core.Verticle
public interface WithTiming
extends io.vertx.core.Verticle
Allows
Verticle instances to get simplified access to the Vert.x timing functions
like setPeriodic
or setTimer.
Usage
public class MyVerticle extends TelestionVerticle<GenericConfiguration> implements WithTiming {
@Override
public void onStart() {
var delay = Duration.ofSeconds(1);
interval(delay, id -> logger.info("Ping!"));
}
}
-
Method Summary
Modifier and TypeMethodDescriptiondefault TimingLikesetPeriodic, but returns a special handler which cancels the interval when called.default TimingLikeinterval(long, Handler), but accepts aDuration.default io.vertx.core.TimeoutStreamintervalStream(long delay)default io.vertx.core.TimeoutStreamintervalStream(Duration delay)LikeintervalStream(long), but accepts aDuration.default TimingLikesetTimer, but returns a special handler which cancels the timeout when called.default TimingLiketimeout(long, Handler), but accepts aDuration.default io.vertx.core.TimeoutStreamtimeoutStream(long delay)default io.vertx.core.TimeoutStreamtimeoutStream(Duration delay)LiketimeoutStream(long), but accepts aDuration.Methods inherited from interface io.vertx.core.Verticle
getVertx, init, start, stop
-
Method Details
-
interval
LikesetPeriodic, but returns a special handler which cancels the interval when called.- Returns:
- a handler which cancels the interval when called
-
interval
Likeinterval(long, Handler), but accepts aDuration. -
intervalStream
default io.vertx.core.TimeoutStream intervalStream(long delay)- See Also:
Vertx.periodicStream(long)
-
intervalStream
LikeintervalStream(long), but accepts aDuration. -
timeout
LikesetTimer, but returns a special handler which cancels the timeout when called.- Returns:
- a handler which cancels the timeout when called
-
timeout
Liketimeout(long, Handler), but accepts aDuration. -
timeoutStream
default io.vertx.core.TimeoutStream timeoutStream(long delay)- See Also:
Vertx.timerStream(long)
-
timeoutStream
LiketimeoutStream(long), but accepts aDuration.
-