Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 772 for future (0.19 sec)

  1. android/guava-tests/benchmark/com/google/common/util/concurrent/FuturesGetCheckedBenchmark.java

        }
      }
    
      private enum Result {
        SUCCESS(immediateFuture(new Object())),
        FAILURE(immediateFailedFuture(new Exception()));
    
        final Future<Object> future;
    
        Result(Future<Object> result) {
          this.future = result;
        }
      }
    
      private enum ExceptionType {
        CHECKED(IOException.class),
        UNCHECKED(RuntimeException.class);
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Mar 22 03:01:34 GMT 2022
    - 6.5K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/util/concurrent/FuturesGetCheckedInputs.java

      static final Future<String> FAILED_FUTURE_OTHER_THROWABLE =
          immediateFailedFuture(OTHER_THROWABLE);
      static final Error ERROR = new Error("mymessage");
      static final Future<String> FAILED_FUTURE_ERROR = immediateFailedFuture(ERROR);
      static final Future<String> RUNTIME_EXCEPTION_FUTURE =
          UncheckedThrowingFuture.throwingRuntimeException(RUNTIME_EXCEPTION);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 13:46:56 GMT 2023
    - 6.2K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/util/concurrent/UninterruptibleFutureTest.java

        SettableFuture<String> future = SettableFuture.create();
        FutureTask<Boolean> interruptReporter = untimedInterruptReporter(future, false);
    
        runNInterruptsTest(times, future, interruptReporter);
      }
    
      private static void runTimedInterruptsTest(int times)
          throws InterruptedException, ExecutionException, TimeoutException {
        SettableFuture<String> future = SettableFuture.create();
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 9.1K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/util/concurrent/AbstractFuture.java

      /**
       * Sets the result of this {@code Future} to match the supplied input {@code Future} once the
       * supplied {@code Future} is done, unless this {@code Future} has already been cancelled or set
       * (including "set asynchronously," defined below).
       *
       * <p>If the supplied future is {@linkplain #isDone done} when this method is called and the call
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 22 21:17:24 GMT 2024
    - 63K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java

                return i;
              }
            };
    
        List<Future<Integer>> futures = executor.invokeAll(Collections.nCopies(10, incrementTask));
    
        for (int i = 0; i < 10; i++) {
          Future<Integer> future = futures.get(i);
          assertTrue("Task should have been run before being returned", future.isDone());
          assertEquals(i, future.get().intValue());
        }
    
    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)
  6. futures/listenablefuture1/src/com/google/common/util/concurrent/ListenableFuture.java

     * result. (If you want such access, you may prefer {@link Futures#addCallback
     * Futures.addCallback}.) Still, direct {@code addListener} calls are occasionally useful:
     *
     * <pre>{@code
     * final String name = ...;
     * inFlight.add(name);
     * ListenableFuture<Result> future = service.query(name);
     * future.addListener(new Runnable() {
     *   public void run() {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Jun 26 21:13:41 GMT 2023
    - 8K bytes
    - Viewed (0)
  7. guava-testlib/src/com/google/common/util/concurrent/testing/MockFutureListener.java

    @GwtIncompatible
    public class MockFutureListener implements Runnable {
      private final CountDownLatch countDownLatch;
      private final ListenableFuture<?> future;
    
      public MockFutureListener(ListenableFuture<?> future) {
        this.countDownLatch = new CountDownLatch(1);
        this.future = future;
    
        future.addListener(this, directExecutor());
      }
    
      @Override
      public void run() {
        countDownLatch.countDown();
      }
    
      /**
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri May 12 18:12:42 GMT 2023
    - 3K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/collect/ConcurrentHashMultisetBasherTest.java

        try {
          List<Future<int[]>> futures = Lists.newArrayListWithExpectedSize(nTasks);
          for (int i = 0; i < nTasks; i++) {
            futures.add(pool.submit(new MutateTask(multiset, keys)));
          }
    
          int[] deltas = new int[3];
          for (Future<int[]> future : futures) {
            int[] taskDeltas = future.get();
            for (int i = 0; i < deltas.length; i++) {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 5.8K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/util/concurrent/UncheckedThrowingFuture.java

        UncheckedThrowingFuture<V> future = new UncheckedThrowingFuture<V>();
        future.complete(checkNotNull(error));
        return future;
      }
    
      public static <V> ListenableFuture<V> throwingRuntimeException(RuntimeException e) {
        UncheckedThrowingFuture<V> future = new UncheckedThrowingFuture<V>();
        future.complete(checkNotNull(e));
        return future;
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 12 20:02:10 GMT 2018
    - 3.2K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/util/concurrent/Uninterruptibles.java

      }
    
      /**
       * Invokes {@code future.}{@link Future#get() get()} uninterruptibly.
       *
       * <p>Similar methods:
       *
       * <ul>
       *   <li>To retrieve a result from a {@code Future} that is already done, use {@link
       *       Futures#getDone Futures.getDone}.
       *   <li>To treat {@link InterruptedException} uniformly with other exceptions, use {@link
       *       Futures#getChecked(Future, Class) Futures.getChecked}.
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Apr 04 09:45:04 GMT 2023
    - 14.4K bytes
    - Viewed (0)
Back to top