Package java.util.concurrent

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


            }
        });

        // Wait at most half a second (TODO: Make this configurable)
        try {
            final Future<String> poll = ecs.poll(timeout, TimeUnit.MILLISECONDS);
            if (poll == null) return null;

            poll.get(timeout, TimeUnit.MILLISECONDS);

            return newClient;
View Full Code Here


      localArrayList.add(localExecutorCompletionService.submit((Callable)localIterator1.next()));
      i--;
      int j = 1;
      while (true)
      {
        Future localFuture1 = localExecutorCompletionService.poll();
        if (localFuture1 == null)
          if (i > 0)
          {
            i--;
            localArrayList.add(localExecutorCompletionService.submit((Callable)localIterator1.next()));
View Full Code Here

          {
            if (j == 0)
              break;
            if (paramBoolean)
            {
              localFuture1 = localExecutorCompletionService.poll(paramLong, TimeUnit.NANOSECONDS);
              if (localFuture1 == null)
                throw new TimeoutException();
              long l2 = System.nanoTime();
              paramLong -= l2 - l1;
              l1 = l2;
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.