Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 177 for task (0.29 sec)

  1. android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java

              throw new TimeoutException("Timeout waiting for task.");
            }
    
            return getValue();
          }
    
          /**
           * Blocks until {@link #complete(Object, Throwable, int)} has been successfully called. Throws
           * a {@link CancellationException} if the task was cancelled, or a {@link ExecutionException}
           * if the task completed with an error.
           */
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Apr 06 12:56:11 GMT 2023
    - 13.6K bytes
    - Viewed (0)
  2. guava/src/com/google/common/cache/CacheLoader.java

          }
    
          @Override
          public ListenableFuture<V> reload(final K key, final V oldValue) {
            ListenableFutureTask<V> task =
                ListenableFutureTask.create(() -> loader.reload(key, oldValue).get());
            executor.execute(task);
            return task;
          }
    
          @Override
          public Map<K, V> loadAll(Iterable<? extends K> keys) throws Exception {
            return loader.loadAll(keys);
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Dec 19 20:20:14 GMT 2022
    - 9.5K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java

        ExecutorService delegate = mock(ExecutorService.class);
        ListeningExecutorService service = listeningDecorator(delegate);
        Runnable task =
            new Runnable() {
              @Override
              public void run() {}
            };
        service.execute(task);
        verify(delegate).execute(task);
      }
    
      public void testListeningDecorator_scheduleSuccess() throws Exception {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 28.2K bytes
    - Viewed (3)
  4. guava-tests/test/com/google/common/util/concurrent/JdkFutureAdaptersTest.java

        assertFalse(listenableFuture.isDone());
    
        listenableFuture.addListener(singleCallListener, directExecutor());
        /*
         * Don't shut down until the listenInPoolThread task has been accepted to
         * run. We want to see what happens when it's interrupted, not when it's
         * rejected.
         */
        submitSuccessful.await();
        executorService.shutdownNow();
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 9.7K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/hash/BloomFilterTest.java

        assertThat(exceptions).isEmpty();
      }
    
      private static List<Throwable> runThreadsAndReturnExceptions(int numThreads, Runnable task) {
        List<Thread> threads = new ArrayList<>(numThreads);
        final List<Throwable> exceptions = new ArrayList<>(numThreads);
        for (int i = 0; i < numThreads; i++) {
          Thread thread = new Thread(task);
          thread.setUncaughtExceptionHandler(
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Nov 09 22:49:56 GMT 2023
    - 21.3K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/util/concurrent/AbstractFutureTest.java

        allTasks.add(setFutureCompleteExceptionallyRunnable);
        allTasks.add(setFutureCancelRunnable);
        for (int k = 0; k < 50; k++) {
          // For each listener we add a task that submits it to the executor directly for the blocking
          // get use case and another task that adds it as a listener to the future to exercise both
          // racing addListener calls and addListener calls completing after the future completes.
          final Runnable listener =
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 46.8K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/util/concurrent/ListenableFutureTask.java

      private final ExecutionList executionList = new ExecutionList();
    
      /**
       * Creates a {@code ListenableFutureTask} that will upon running, execute the given {@code
       * Callable}.
       *
       * @param callable the callable task
       * @since 10.0
       */
      public static <V extends @Nullable Object> ListenableFutureTask<V> create(Callable<V> callable) {
        return new ListenableFutureTask<>(callable);
      }
    
      /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Apr 04 09:45:04 GMT 2023
    - 4.3K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/util/concurrent/AbstractScheduledServiceTest.java

        final CyclicBarrier firstBarrier = new CyclicBarrier(2);
        final CyclicBarrier secondBarrier = new CyclicBarrier(2);
        final AtomicBoolean shouldWait = new AtomicBoolean(true);
        Runnable task =
            new Runnable() {
              @Override
              public void run() {
                try {
                  if (shouldWait.get()) {
                    firstBarrier.await();
                    secondBarrier.await();
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 22.5K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/util/concurrent/GeneratedMonitorTest.java

              public void run() {
                runChosenTest();
              }
            };
        final FutureTask<@Nullable Void> task = new FutureTask<>(runChosenTest, null);
        startThread(
            new Runnable() {
              @Override
              public void run() {
                task.run();
              }
            });
        awaitUninterruptibly(doingCallLatch);
        long hangDelayMillis =
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Mon Apr 17 14:48:57 GMT 2023
    - 27.4K bytes
    - Viewed (0)
  10. android/guava-tests/benchmark/com/google/common/collect/ConcurrentHashMultisetBenchmark.java

              }
            });
      }
    
      private long doMultithreadedLoop(Callable<Long> task)
          throws InterruptedException, ExecutionException {
    
        List<Future<Long>> futures = Lists.newArrayListWithCapacity(threads);
        for (int i = 0; i < threads; i++) {
          futures.add(threadPool.submit(task));
        }
        long total = 0;
        for (Future<Long> future : futures) {
          total += future.get();
        }
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Apr 06 12:56:11 GMT 2023
    - 16.6K bytes
    - Viewed (0)
Back to top