Package org.zeromq

Examples of org.zeromq.ZContext.destroy()


            msg.send(server);
        }
        if (Thread.currentThread().isInterrupted())
            System.out.printf ("W: interrupted\n");

        ctx.destroy();
    }
}
View Full Code Here


        Socket listener = ZThread.fork(ctx, new Listener());
        ZMQ.proxy (subscriber, publisher, listener);

        System.out.println(" interrupted");
        //  Tell attached threads to exit
        ctx.destroy();
    }
}
View Full Code Here

        kvsimple kvUpdateMsg = new kvsimple(key + "", 0, b.array());
        kvUpdateMsg.send(push);
        alarm = System.currentTimeMillis() + 1000;
      }
    }
        ctx.destroy();
  }

  public static void main(String[] args) {
    new clonecli3().run();
  }
View Full Code Here

                kvsimple message = new kvsimple("KTHXBAI", sequence, "".getBytes());
                message.send(snapshot);
            }
        }
        System.out.printf (" Interrupted\n%d messages handled\n", sequence);
        ctx.destroy();
    }

    private void sendMessage(kvsimple msg, byte[] identity, String subtree, Socket snapshot) {
        snapshot.send(identity, ZMQ.SNDMORE);
        snapshot.send(subtree, ZMQ.SNDMORE);
View Full Code Here

            reply.send(server);
        }
        if (Thread.currentThread().isInterrupted())
            System.out.printf ("W: interrupted\n");

        ctx.destroy();
    }
}
View Full Code Here

                kvsimple message = new kvsimple("KTHXBAI", sequence, "".getBytes());
                message.send(snapshot);
            }
        }
        System.out.printf (" Interrupted\n%d messages handled\n", sequence);
        ctx.destroy();
    }

    private void sendMessage(kvsimple msg, byte[] identity, Socket snapshot) {
        snapshot.send(identity, ZMQ.SNDMORE);
        msg.send(snapshot);
View Full Code Here

        while (workers.size() > 0) {
            ZFrame frame = workers.remove(0);
            frame.destroy();
        }

        ctx.destroy();
    }
}
View Full Code Here

                        assert (reply.equals(taskId));
                        monitor.send(String.format("%s", reply), 0);
                    } else {
                        monitor.send(
                                String.format("E: CLIENT EXIT - lost task %s", taskId), 0);
                        ctx.destroy();
                        return;
                    }
                    burst--;
                }
            }
View Full Code Here

                }

                msg.send(worker);

            }
            ctx.destroy();
        }
    }

    //  The main task begins by setting-up all its sockets. The local frontend
    //  talks to clients, and our local backend talks to workers. The cloud
View Full Code Here

            }

        }
        System.out.printf(" Interrupted\n%d messages out\n", sequence);

        ctx.destroy();
  }

  public static class StateManager implements IAttachedRunnable {
    private static Map<String, kvsimple> kvMap = new LinkedHashMap<String, kvsimple>();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.