Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 177 for task (0.18 sec)

  1. android/guava/src/com/google/common/util/concurrent/SequentialExecutor.java

                  }
                }
                task = queue.poll();
                if (task == null) {
                  workerRunningState = IDLE;
                  return;
                }
              }
              // Remove the interrupt bit before each task. The interrupt is for the "current task" when
              // it is sent, so subsequent tasks in the queue should not be caused to be interrupted
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 01 21:46:34 GMT 2024
    - 10.6K bytes
    - Viewed (0)
  2. android/guava-testlib/src/com/google/common/util/concurrent/testing/SameThreadScheduledExecutorService.java

      public <T> ListenableFuture<T> submit(Callable<T> task) {
        Preconditions.checkNotNull(task, "task must not be null!");
        return delegate.submit(task);
      }
    
      @Override
      public <T> ListenableFuture<T> submit(Runnable task, T result) {
        Preconditions.checkNotNull(task, "task must not be null!");
        Preconditions.checkNotNull(result, "result must not be null!");
        return delegate.submit(task, result);
      }
    
      @Override
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Oct 06 00:47:57 GMT 2021
    - 6.4K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/util/concurrent/ListenableFutureTaskTest.java

        assertFalse(task.isDone());
        assertFalse(task.isCancelled());
    
        // Start the task to put it in the RUNNING state.  Have to use a separate
        // thread because the task will block on the task latch after unblocking
        // the run latch.
        exec.execute(task);
        runLatch.await();
        assertEquals(1, listenerLatch.getCount());
        assertFalse(task.isDone());
        assertFalse(task.isCancelled());
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 4.7K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/util/concurrent/TrustedListenableFutureTaskTest.java

        TrustedListenableFutureTask<Integer> task = TrustedListenableFutureTask.create(returning(2));
        assertFalse(task.isDone());
        task.run();
        assertTrue(task.isDone());
        assertFalse(task.isCancelled());
        assertEquals(2, getDone(task).intValue());
      }
    
      public void testCancelled() throws Exception {
        TrustedListenableFutureTask<Integer> task = TrustedListenableFutureTask.create(returning(2));
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 7.3K bytes
    - Viewed (0)
  5. android/guava-testlib/src/com/google/common/util/concurrent/testing/TestingExecutors.java

       * implemented as "no-effort". No interrupts or other attempts are made to stop threads executing
       * tasks. Second, the returned list will always be empty, as any submitted task is considered to
       * have started execution. This applies also to tasks given to {@code invokeAll} or {@code
       * invokeAny} which are pending serial execution, even the subset of the tasks that have not yet
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri May 26 22:04:00 GMT 2023
    - 6.7K bytes
    - Viewed (0)
  6. android/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 26 12:43:10 GMT 2024
    - Last Modified: Mon Dec 19 20:20:14 GMT 2022
    - 9.6K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/util/concurrent/WrappingExecutorService.java

      }
    
      /**
       * Wraps a collection of tasks.
       *
       * @throws NullPointerException if any element of {@code tasks} is null
       */
      private <T extends @Nullable Object> ImmutableList<Callable<T>> wrapTasks(
          Collection<? extends Callable<T>> tasks) {
        ImmutableList.Builder<Callable<T>> builder = ImmutableList.builder();
        for (Callable<T> task : tasks) {
          builder.add(wrapTask(task));
        }
        return builder.build();
      }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Apr 04 09:45:04 GMT 2023
    - 5.5K bytes
    - Viewed (0)
  8. guava-testlib/src/com/google/common/util/concurrent/testing/SameThreadScheduledExecutorService.java

      public <T> ListenableFuture<T> submit(Callable<T> task) {
        Preconditions.checkNotNull(task, "task must not be null!");
        return delegate.submit(task);
      }
    
      @Override
      public <T> ListenableFuture<T> submit(Runnable task, T result) {
        Preconditions.checkNotNull(task, "task must not be null!");
        Preconditions.checkNotNull(result, "result must not be null!");
        return delegate.submit(task, result);
      }
    
      @Override
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Oct 06 00:47:57 GMT 2021
    - 6.4K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/util/concurrent/SequentialExecutorTest.java

      private static class FakeExecutor implements Executor {
        Queue<Runnable> tasks = Queues.newArrayDeque();
    
        @Override
        public void execute(Runnable command) {
          tasks.add(command);
        }
    
        boolean hasNext() {
          return !tasks.isEmpty();
        }
    
        void runNext() {
          assertTrue("expected at least one task to run", hasNext());
          tasks.remove().run();
        }
    
        void runAll() {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 11.4K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/util/concurrent/RateLimiter.java

     * <p>As an example, imagine that we have a list of tasks to execute, but we don't want to submit
     * more than 2 per second:
     *
     * <pre>{@code
     * final RateLimiter rateLimiter = RateLimiter.create(2.0); // rate is "2 permits per second"
     * void submitTasks(List<Runnable> tasks, Executor executor) {
     *   for (Runnable task : tasks) {
     *     rateLimiter.acquire(); // may wait
     *     executor.execute(task);
     *   }
     * }
     * }</pre>
     *
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Apr 04 09:45:04 GMT 2023
    - 18.2K bytes
    - Viewed (0)
Back to top