本文整理了Java中org.zeromq.ZLoop
类的一些代码示例,展示了ZLoop
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZLoop
类的具体详情如下:
包路径:org.zeromq.ZLoop
类名称:ZLoop
[英]The 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.
[中]ZLoop类提供了一种事件驱动的反应器模式。反应堆处理zmq。轮询项项目(轮询器或写入器、套接字或FD),以及一次性或重复计时器。其分辨率为1毫秒。它使用无滴答的计时器来减少非活动进程中的CPU中断。
代码示例来源:origin: org.projectreactor/reactor-net
public void shutdown() {
if (closed) {
return;
}
zloop.removePoller(pollin);
zloop.destroy();
closed = true;
if (shutdownCtx) {
zmq.destroy();
}
}
代码示例来源:origin: org.projectreactor/reactor-net
@Override
public void run() {
if (closed) {
return;
}
if (null == zmq) {
zmq = new ZContext(ioThreadCount);
shutdownCtx = true;
}
socket = zmq.createSocket(socketType);
socket.setIdentity(id.toString().getBytes());
configure(socket);
pollin = new ZMQ.PollItem(socket, ZMQ.Poller.POLLIN);
if (log.isTraceEnabled()) {
zloop.verbose(true);
}
zloop.addPoller(pollin, inputHandler, null);
start(socket);
zloop.start();
zmq.destroySocket(socket);
}
代码示例来源:origin: org.zeromq/jeromq
rebuild();
long wait = ticklessTimer();
removePoller(poller.item);
代码示例来源:origin: io.projectreactor/reactor-net
@Override
public void run() {
try {
if (closed) {
return;
}
if (null == zmq) {
zmq = new ZContext(ioThreadCount);
shutdownCtx = true;
}
socket = zmq.createSocket(socketType);
socket.setIdentity(id.toString().getBytes());
configure(socket);
pollin = new ZMQ.PollItem(socket, ZMQ.Poller.POLLIN);
if (log.isDebugEnabled()) {
zloop.verbose(true);
}
zloop.addPoller(pollin, inputHandler, null);
start(socket);
zloop.start();
zmq.destroySocket(socket);
} catch (Exception e) {
b.onError(e);
}
}
代码示例来源:origin: io.projectreactor/reactor-net
public void shutdown() {
if (closed) {
return;
}
zloop.removePoller(pollin);
zloop.destroy();
closed = true;
if (shutdownCtx) {
zmq.destroy();
}
b.onComplete();
}
内容来源于网络,如有侵权,请联系作者删除!