Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 11 for AsyncCallable (0.29 seconds)

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

        return () -> value;
      }
    
      /**
       * Creates an {@link AsyncCallable} from a {@link Callable}.
       *
       * <p>The {@link AsyncCallable} returns the {@link ListenableFuture} resulting from {@link
       * ListeningExecutorService#submit(Callable)}.
       *
       * @since 20.0
       */
      @J2ktIncompatible
      @GwtIncompatible
      public static <T extends @Nullable Object> AsyncCallable<T> asAsyncCallable(
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Thu Aug 07 16:05:33 GMT 2025
    - 4.3K bytes
    - Click Count (0)
  2. android/guava-tests/test/com/google/common/util/concurrent/CallablesTest.java

        String expected = "MyCallableString";
        Callable<String> callable = () -> expected;
    
        AsyncCallable<String> asyncCallable =
            Callables.asAsyncCallable(callable, newDirectExecutorService());
    
        ListenableFuture<String> future = asyncCallable.call();
        assertThat(future.get()).isEqualTo(expected);
      }
    
      @J2ktIncompatible
      @GwtIncompatible
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Mar 16 22:45:21 GMT 2026
    - 4K bytes
    - Click Count (0)
  3. guava-tests/test/com/google/common/util/concurrent/CallablesTest.java

        String expected = "MyCallableString";
        Callable<String> callable = () -> expected;
    
        AsyncCallable<String> asyncCallable =
            Callables.asAsyncCallable(callable, newDirectExecutorService());
    
        ListenableFuture<String> future = asyncCallable.call();
        assertThat(future.get()).isEqualTo(expected);
      }
    
      @J2ktIncompatible
      @GwtIncompatible
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Mar 16 22:45:21 GMT 2026
    - 4K bytes
    - Click Count (0)
  4. android/guava/src/com/google/common/util/concurrent/ExecutionSequencer.java

       * callable} or a callable that has begun to execute, but if the output future is cancelled before
       * {@link AsyncCallable#call()} is invoked, {@link AsyncCallable#call()} will not be invoked.
       */
      public <T extends @Nullable Object> ListenableFuture<T> submitAsync(
          AsyncCallable<T> callable, Executor executor) {
        checkNotNull(callable);
        checkNotNull(executor);
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Tue Sep 23 01:35:55 GMT 2025
    - 22.1K bytes
    - Click Count (0)
  5. android/guava/src/com/google/common/util/concurrent/TrustedListenableFutureTask.java

        }
      }
    
      @WeakOuter
      private final class TrustedFutureInterruptibleAsyncTask
          extends InterruptibleTask<ListenableFuture<V>> {
        private final AsyncCallable<V> callable;
    
        TrustedFutureInterruptibleAsyncTask(AsyncCallable<V> callable) {
          this.callable = checkNotNull(callable);
        }
    
        @Override
        final boolean isDone() {
          return TrustedListenableFutureTask.this.isDone();
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Fri Jul 11 18:52:30 GMT 2025
    - 5.5K bytes
    - Click Count (0)
  6. android/guava-tests/test/com/google/common/util/concurrent/FuturesTest.java

        @SuppressWarnings("AnonymousToLambda") // We want an instance that can be GCed.
        AsyncCallable<Long> combiner =
            new AsyncCallable<Long>() {
              @Override
              public ListenableFuture<Long> call() {
                return SettableFuture.create();
              }
            };
        WeakReference<AsyncCallable<Long>> combinerRef = new WeakReference<>(combiner);
    
        ListenableFuture<Long> unused =
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Mar 16 22:45:21 GMT 2026
    - 134K bytes
    - Click Count (0)
  7. guava-tests/test/com/google/common/util/concurrent/FuturesTest.java

        @SuppressWarnings("AnonymousToLambda") // We want an instance that can be GCed.
        AsyncCallable<Long> combiner =
            new AsyncCallable<Long>() {
              @Override
              public ListenableFuture<Long> call() {
                return SettableFuture.create();
              }
            };
        WeakReference<AsyncCallable<Long>> combinerRef = new WeakReference<>(combiner);
    
        ListenableFuture<Long> unused =
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Mar 16 22:45:21 GMT 2026
    - 134K bytes
    - Click Count (0)
  8. android/guava/src/com/google/common/util/concurrent/Futures.java

       *
       * @throws RejectedExecutionException if the task cannot be scheduled for execution
       * @since 23.0
       */
      public static <O extends @Nullable Object> ListenableFuture<O> submitAsync(
          AsyncCallable<O> callable, Executor executor) {
        TrustedListenableFutureTask<O> task = TrustedListenableFutureTask.create(callable);
        executor.execute(task);
        return task;
      }
    
      /**
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Tue Mar 17 19:26:39 GMT 2026
    - 64.2K bytes
    - Click Count (0)
  9. guava-tests/test/com/google/common/util/concurrent/ExecutionSequencerTest.java

        }
    
        void stop() {
          stopLatch.countDown();
        }
    
        boolean isRunning() {
          return running;
        }
      }
    
      private static final class TestCallable implements AsyncCallable<@Nullable Void> {
    
        private final ListenableFuture<@Nullable Void> future;
        private boolean called = false;
    
        private TestCallable(ListenableFuture<@Nullable Void> future) {
          this.future = future;
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Mar 16 22:45:21 GMT 2026
    - 13.6K bytes
    - Click Count (0)
  10. android/guava-tests/test/com/google/common/util/concurrent/ExecutionSequencerTest.java

        }
    
        void stop() {
          stopLatch.countDown();
        }
    
        boolean isRunning() {
          return running;
        }
      }
    
      private static final class TestCallable implements AsyncCallable<@Nullable Void> {
    
        private final ListenableFuture<@Nullable Void> future;
        private boolean called = false;
    
        private TestCallable(ListenableFuture<@Nullable Void> future) {
          this.future = future;
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Mar 16 22:45:21 GMT 2026
    - 13.6K bytes
    - Click Count (0)
Back to Top