Examples of poll()


Examples of java.util.concurrent.LinkedBlockingQueue.poll()

      int numberOfProducers = SeveralClientsStressTest.NUMBER_OF_PRODUCERS;
      int numberOfConsumers = SeveralClientsStressTest.NUMBER_OF_CONSUMERS;

      while (threads.size() > 0)
      {
         SeveralClientsStressTest.InternalMessage msg = (SeveralClientsStressTest.InternalMessage)testChannel.poll(2000,
                                                                                                                   TimeUnit.MILLISECONDS);

         log.info("Produced:" + SeveralClientsStressTest.producedMessages.get() +
                  " and Consumed:" +
                  SeveralClientsStressTest.readMessages.get() +
View Full Code Here

Examples of net.java.games.input.Controller.poll()

        }

        @SuppressWarnings("unused") float dx = 0;

        while (running) {
            joystick.poll();
            for (Component c : joystick.getComponents()) {

                if (c.getName().equals("x")) {
                    dx += c.getPollData();
                } else if (c.getName().equals("pov")) {
View Full Code Here

Examples of net.java.games.input.Controller.poll()

            boolean flyUp = Keyboard.isKeyDown(Keyboard.KEY_SPACE);
            boolean flyDown = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT);
            boolean moveFaster = Keyboard.isKeyDown(Keyboard.KEY_LCONTROL);
            boolean moveSlower = Keyboard.isKeyDown(Keyboard.KEY_TAB);

            joystick.poll();
            for (Component c : joystick.getComponents()) {
                double dy = 0, dx = 0;
                if (c.getName().equals("x")) {
                    joystickSpeed = (int) ((-c.getPollData() + 1.1) * 10);
                    if (c.getPollData() < -.004) {
View Full Code Here

Examples of net.java.games.input.Keyboard.poll()

   
    // Starting the rendering
    long lastVSyncChange = 0;
    while(true) {
      if(keyboard != null) {
        keyboard.poll();
     
        // End demo
        if(keyboard.isKeyDown(Key.Q) || keyboard.isKeyDown(Key.ESCAPE)) {
          canvas.dispose();
          System.exit(0);
View Full Code Here

Examples of net.kuujo.copycat.spi.protocol.ProtocolClient.poll()

      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 net.openhft.chronicle.sandbox.queue.LocalConcurrentBlockingObjectQueue.poll()

        for (int i = 0; i < SIZE; ++i)
            ints[i] = i;
        Collection<Integer> elements = Arrays.asList(ints);
        BlockingQueue q = new LocalConcurrentBlockingObjectQueue(SIZE, true, elements);
        for (int i = 0; i < SIZE; ++i)
            assertEquals(ints[i], q.poll());
    }

    /**
     * Queue transitions from empty to full when elements added
     */
 
View Full Code Here

Examples of org.apache.geronimo.remoting.transport.async.Correlator.FutureResult.poll()

        } finally {
            safeClose(c);
        }

        try {
            Msg result = (AsyncMsg) requestId.poll(Registry.REQUEST_TIMEOUT);
            if (log.isTraceEnabled())
                log.trace("response data was corelated for request: " + requestId.getID());
            if (result == null)
                throw new TransportException("Request time out.");
            return result;
View Full Code Here

Examples of org.apache.mina.common.WriteRequestQueue.poll()

                    if (queue.isEmpty(session)) {
                        return;
                    }
                    WriteRequest req;
                    long currentTime = System.currentTimeMillis();
                    while ((req = queue.poll(session)) != null) {
                        Object m = req.getMessage();
                        pushEvent(new IoEvent(IoEventType.MESSAGE_SENT, session, req), false);
                        session.getRemoteSession().getFilterChain().fireMessageReceived(
                                getMessageCopy(m));
                        if (m instanceof IoBuffer) {
View Full Code Here

Examples of org.apache.mina.common.WriteRequestQueue.poll()

                flushPendingDataQueues(session);
            } else {
                List<WriteRequest> failedRequests = new ArrayList<WriteRequest>();
                WriteRequest req;
                while ((req = queue.poll(session)) != null) {
                    failedRequests.add(req);
                }

                if (!failedRequests.isEmpty()) {
                    WriteToClosedSessionException cause = new WriteToClosedSessionException(failedRequests);
View Full Code Here

Examples of org.apache.mina.core.write.WriteRequestQueue.poll()

        WriteRequestQueue writeRequestQueue = session.getWriteRequestQueue();
        WriteRequest req;

        List<WriteRequest> failedRequests = new ArrayList<WriteRequest>();

        if ((req = writeRequestQueue.poll(session)) != null) {
            Object message = req.getMessage();
           
            if (message instanceof IoBuffer) {
                IoBuffer buf = (IoBuffer)message;
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.