Package org.zeromq
Class ZLoop
- java.lang.Object
-
- org.zeromq.ZLoop
-
public class ZLoop extends java.lang.ObjectThe ZLoop class provides an event-driven reactor pattern. The reactor handles zmq.PollItem items (pollers or writers, sockets or fds), and once-off or repeated timers. Its resolution is 1 msec. It uses a tickless timer to reduce CPU interrupts in inactive processes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceZLoop.IZLoopHandlerprivate classZLoop.SPollerprivate classZLoop.STimer
-
Field Summary
Fields Modifier and Type Field Description private ZMQ.Contextcontextprivate booleandirtyprivate java.util.List<ZLoop.STimer>newTimersprivate ZLoop.SPoller[]pollactprivate java.util.List<ZLoop.SPoller>pollersprivate ZMQ.Pollerpollsetprivate intpollSizeprivate java.util.List<ZLoop.STimer>timersprivate booleanverboseprivate java.util.List<java.lang.Object>zombies
-
Constructor Summary
Constructors Constructor Description ZLoop(ZContext ctx)ZLoop(ZMQ.Context context)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intaddPoller(ZMQ.PollItem pollItem, ZLoop.IZLoopHandler handler, java.lang.Object arg)intaddTimer(int delay, int times, ZLoop.IZLoopHandler handler, java.lang.Object arg)voiddestroy()Deprecated.no-op behaviourprivate voidrebuild()voidremovePoller(ZMQ.PollItem pollItem)intremoveTimer(java.lang.Object arg)intstart()private longticklessTimer()voidverbose(boolean verbose)
-
-
-
Field Detail
-
context
private final ZMQ.Context context
-
pollers
private final java.util.List<ZLoop.SPoller> pollers
-
timers
private final java.util.List<ZLoop.STimer> timers
-
pollSize
private int pollSize
-
pollset
private ZMQ.Poller pollset
-
pollact
private ZLoop.SPoller[] pollact
-
dirty
private boolean dirty
-
verbose
private boolean verbose
-
zombies
private final java.util.List<java.lang.Object> zombies
-
newTimers
private final java.util.List<ZLoop.STimer> newTimers
-
-
Constructor Detail
-
ZLoop
public ZLoop(ZMQ.Context context)
-
ZLoop
public ZLoop(ZContext ctx)
-
-
Method Detail
-
destroy
@Deprecated public void destroy()
Deprecated.no-op behaviour
-
rebuild
private void rebuild()
-
ticklessTimer
private long ticklessTimer()
-
addPoller
public int addPoller(ZMQ.PollItem pollItem, ZLoop.IZLoopHandler handler, java.lang.Object arg)
-
removePoller
public void removePoller(ZMQ.PollItem pollItem)
-
addTimer
public int addTimer(int delay, int times, ZLoop.IZLoopHandler handler, java.lang.Object arg)
-
removeTimer
public int removeTimer(java.lang.Object arg)
-
verbose
public void verbose(boolean verbose)
-
start
public int start()
-
-