Examples of PollRequest


Examples of com.hazelcast.queue.client.PollRequest

    public E take() throws InterruptedException {
        return poll(-1, TimeUnit.MILLISECONDS);
    }

    public E poll(long timeout, TimeUnit unit) throws InterruptedException {
        PollRequest request = new PollRequest(name, unit.toMillis(timeout));
        return invokeInterruptibly(request);
    }
View Full Code Here

Examples of com.hazelcast.queue.client.PollRequest

            }
        };
        constructors[POLL] = new ConstructorFunction<Integer, Portable>() {
            @Override
            public Portable createNew(Integer arg) {
                return new PollRequest();
            }
        };
        constructors[PEEK] = new ConstructorFunction<Integer, Portable>() {
            @Override
            public Portable createNew(Integer arg) {
View Full Code Here

Examples of com.hazelcast.queue.client.PollRequest

    public E take() throws InterruptedException {
        return poll(-1, TimeUnit.MILLISECONDS);
    }

    public E poll(long timeout, TimeUnit unit) throws InterruptedException {
        PollRequest request = new PollRequest(name, unit.toMillis(timeout));
        return invokeInterruptibly(request);
    }
View Full Code Here

Examples of com.hazelcast.queue.impl.client.PollRequest

    public E take() throws InterruptedException {
        return poll(-1, TimeUnit.MILLISECONDS);
    }

    public E poll(long timeout, TimeUnit unit) throws InterruptedException {
        PollRequest request = new PollRequest(name, unit.toMillis(timeout));
        return invokeInterruptibly(request);
    }
View Full Code Here

Examples of com.hazelcast.queue.impl.client.PollRequest

            }
        };
        constructors[POLL] = new ConstructorFunction<Integer, Portable>() {
            @Override
            public Portable createNew(Integer arg) {
                return new PollRequest();
            }
        };
        constructors[PEEK] = new ConstructorFunction<Integer, Portable>() {
            @Override
            public Portable createNew(Integer arg) {
View Full Code Here

Examples of com.hazelcast.queue.impl.client.PollRequest

    @Test
    public void testPoll() throws IOException {
        final IQueue q = getQueue();
        final SimpleClient client = getClient();
        client.send(new PollRequest(queueName));
        Object result = client.receive();
        assertNull(result);

        q.offer("item1");
        client.send(new PollRequest(queueName));
        result = client.receive();
        assertEquals("item1", result);
        assertEquals(0, q.size());

        new Thread() {
            public void run() {
                try {
                    Thread.sleep(3000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                q.offer("item2");
            }
        }.start();
        client.send(new PollRequest(queueName, 10 * 1000));
        result = client.receive();
        assertEquals("item2", result);
        assertEquals(0, q.size());
    }
View Full Code Here

Examples of net.kuujo.copycat.protocol.PollRequest

      client.connect().whenComplete((result1, error1) -> {
        if (error1 != null) {
          quorum.fail();
        } else {
          LOGGER.debug("{} - Polling {}", context.clusterManager().localNode(), node.member());
          client.poll(new PollRequest(context.nextCorrelationId(), context.currentTerm(), context.clusterManager()
            .localNode()
            .member()
            .id(), lastIndex, lastTerm)).whenComplete((result2, error2) -> {
            client.close();
            if (!complete.get()) {
View Full Code Here

Examples of org.jboss.seam.remoting.messaging.PollRequest

      List<PollRequest> requests = new ArrayList<PollRequest>();

      List<Element> requestElements = env.element("body").elements("poll");
      for (Element e : requestElements)
      {
        requests.add(new PollRequest(e.attributeValue("token"),
                                     Integer.parseInt(e.attributeValue("timeout"))));
      }

      return requests;
    }
View Full Code Here

Examples of org.jboss.seam.remoting.messaging.PollRequest

      List<PollRequest> requests = new ArrayList<PollRequest>();

      List<Element> requestElements = env.element("body").elements("poll");
      for (Element e : requestElements)
      {
        requests.add(new PollRequest(e.attributeValue("token"),
                                     Integer.parseInt(e.attributeValue("timeout"))));
      }

      return requests;
    }
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.