Package java.util.concurrent

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


      try {
         maxNumberInvariant.readLock().lock();
         Object result;
         try {
            // first try to take an element without waiting
            result = queue.poll();
            if (result == null) {
               // there are no elements in the queue, make sure the producer is started
               keyProducerStartLatch.open();
               // our address might have been removed from the consistent hash
               if (!address.equals(getAddressForKey(address)))
View Full Code Here


            }

            public void onFailure(Throwable t) {
            }
        });
        Object response = qResponse.poll(10, TimeUnit.SECONDS);
        assertNotNull(response);
        assertTrue(response instanceof Member);
    }

    @Test
View Full Code Here

      try {
         maxNumberInvariant.readLock().lock();
         Object result;
         try {
            // first try to take an element without waiting
            result = queue.poll();
            if (result == null) {
               // there are no elements in the queue, make sure the producer is started
               keyProducerStartLatch.open();
               // our address might have been removed from the consistent hash
               if (!address.equals(getAddressForKey(address)))
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.