144145146147148149150151152
System.out.println ("I: worker heartbeat\n"); ZFrame frame = new ZFrame (PPP_HEARTBEAT); frame.send(worker, 0); } } ctx.destroy(); } }
6162636465666768
// Send random values for worker availability statebe.send(self, ZMQ.SNDMORE); statebe.send(String.format("%d", rand.nextInt(10)), 0); } } ctx.destroy(); } }
378379380381382383384385386387388
assert (kvmsg.getProp("prop2").equals("value2")); kvmsg.destroy(); // .skip // Shutdown and destroy all objects ctx.destroy(); System.out.printf("OK\n"); } // .until
7172737475767778
// Send request again, on new socket client.send(request); } } } ctx.destroy(); } }
8687888990919293949596
kvsimple kvUpdateMsg = new kvsimple(key, 0, b.array()); kvUpdateMsg.send(push); alarm = System.currentTimeMillis() + 1000; } } ctx.destroy(); } public static void main(String[] args) { new clonecli4().run(); }
6667686970717273
} } frame.destroy(); } } context.destroy(); } }
151152153154155156157158159
// When we're done, clean up properly while ( workers.size() > 0) { Worker worker = workers.remove(0); } workers.clear(); ctx.destroy(); } }
4849505152535455
reply.send(server); } if (Thread.currentThread().isInterrupted()) System.out.printf ("W: interrupted\n"); ctx.destroy(); } }
93949596979899100
Socket pubpipe = ZThread.fork(ctx, new Publisher()); Socket subpipe = ZThread.fork(ctx, new Subscriber()); subpipe.recvStr(); pubpipe.send("break"); Thread.sleep(100); ctx.destroy(); } }
3132333435363738
while (!Thread.currentThread().isInterrupted()) { Thread.sleep(1000); publisher.send(String.format("%03d", rand.nextInt(1000)), ZMQ.SNDMORE); publisher.send("Off with his head!"); } context.destroy(); } }