Examples of pollin()


Examples of org.zeromq.ZMQ.Poller.pollin()

            if (items.poll() < 0)
                break;

            //  Handle worker activity on backend
            if (items.pollin(0)) {

                //  Queue worker address for LRU routing
                workerQueue.add (backend.recvStr ());

                //  Second frame is empty
View Full Code Here

Examples of org.zeromq.ZMQ.Poller.pollin()

                        break;
                }

            }

            if (items.pollin(1)) {
                //  Now get next client request, route to LRU worker
                //  Client request is [address][empty][request]
                String clientAddr = frontend.recvStr ();

                String empty = frontend.recvStr ();
View Full Code Here

Examples of org.zeromq.ZMQ.Poller.pollin()

    while (true) {
      int rc = poller.poll(Math.max(0, alarm - System.currentTimeMillis()));
            if (rc == -1)
                break;              //  Context has been shut down

      if (poller.pollin(0)) {
                kvsimple kvMsg = kvsimple.recv(subscriber);
                if (kvMsg == null)
                    break;      //  Interrupted
                if (kvMsg.getSequence() > sequence) {
                    sequence = kvMsg.getSequence();
View Full Code Here

Examples of org.zeromq.ZMQ.Poller.pollin()

        while (!Thread.currentThread().isInterrupted()) {
            if (poller.poll(1000) < 0)
                break;              //  Context has been shut down

            // apply state updates from main thread
            if (poller.pollin(0)) {
                kvsimple kvMsg = kvsimple.recv(collector);
                if (kvMsg == null//  Interrupted
                    break;
                kvMsg.setSequence(++sequence);
                kvMsg.send(publisher);
View Full Code Here

Examples of org.zeromq.ZMQ.Poller.pollin()

                clonesrv4.kvMap.put(kvMsg.getKey(), kvMsg);
                System.out.printf("I: publishing update %5d\n", sequence);
            }

            // execute state snapshot request
            if (poller.pollin(1)) {
                byte[] identity = snapshot.recv(0);
                if (identity == null)
                    break;      //  Interrupted

                //  .until
View Full Code Here

Examples of org.zeromq.ZMQ.Poller.pollin()

        while (!Thread.currentThread().isInterrupted()) {
            if (poller.poll(1000) < 0)
                break;              //  Context has been shut down

            // apply state updates from main thread
            if (poller.pollin(0)) {
                kvsimple kvMsg = kvsimple.recv(collector);
                if (kvMsg == null//  Interrupted
                    break;
                kvMsg.setSequence(++sequence);
                kvMsg.send(publisher);
View Full Code Here

Examples of org.zeromq.ZMQ.Poller.pollin()

                clonesrv3.kvMap.put(kvMsg.getKey(), kvMsg);
                System.out.printf("I: publishing update %5d\n", sequence);
            }

            // execute state snapshot request
            if (poller.pollin(1)) {
                byte[] identity = snapshot.recv(0);
                if (identity == null)
                    break;      //  Interrupted
                String request = snapshot.recvStr();
View Full Code Here

Examples of org.zeromq.ZMQ.Poller.pollin()

      while (!Thread.currentThread().isInterrupted()) {
        if (poller.poll() < 0)
                    break;              //  Context has been shut down

        // apply state updates from main thread
        if (poller.pollin(0)) {
          kvsimple kvMsg = kvsimple.recv(pipe);
                    if (kvMsg == null)
                        break;
          StateManager.kvMap.put(kvMsg.getKey(), kvMsg);
          stateSequence = kvMsg.getSequence();
View Full Code Here

Examples of org.zeromq.ZMQ.Poller.pollin()

          StateManager.kvMap.put(kvMsg.getKey(), kvMsg);
          stateSequence = kvMsg.getSequence();
        }

        // execute state snapshot request
        if (poller.pollin(1)) {
          byte[] identity = snapshot.recv(0);
                    if (identity == null)
                        break;
          String request = new String(snapshot.recv(0));
View Full Code Here

Examples of org.zeromq.ZMQ.Poller.pollin()

            if (items.poll() < 0)
                break;      //  Interrupted

            //  Handle worker activity on backend
            if (items.pollin(0)) {

                ZMsg msg = ZMsg.recvMsg (backend);
                if (msg == null)
                    break//  Interrupted
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.