Package org.zeromq.timer
Class ZTicker
- java.lang.Object
-
- org.zeromq.timer.ZTicker
-
public final class ZTicker extends java.lang.Object
Manages set of tickets and timers.Tickets can be added with a given delay in milliseconds, when the delay expires after addition, handler method is executed with given arguments.
Ticket is NOT repetitive and will be executed once unless canceled.Timers can be added with a given interval in milliseconds, when the interval of time expires after addition, handler method is executed with given arguments.
Timer is repetitive and will be executed over time until canceled.This is a DRAFT class, and may change without notice.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ZTicket.Ticket
addTicket(long interval, TimerHandler handler, java.lang.Object... args)
ZTimer.Timer
addTimer(long interval, TimerHandler handler, java.lang.Object... args)
int
execute()
long
timeout()
-
-
-
Constructor Detail
-
ZTicker
public ZTicker()
-
ZTicker
ZTicker(Supplier<java.lang.Long> clock)
-
-
Method Detail
-
addTicket
public ZTicket.Ticket addTicket(long interval, TimerHandler handler, java.lang.Object... args)
-
addTimer
public ZTimer.Timer addTimer(long interval, TimerHandler handler, java.lang.Object... args)
-
timeout
public long timeout()
-
execute
public int execute()
-
-