Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 510 for Future (0.2 sec)

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

              }
            };
          }
        },
        ABSTRACT_FUTURE {
          @Override
          ExecutionListWrapper newExecutionList() {
            return new ExecutionListWrapper() {
              final AbstractFuture<?> future = new AbstractFuture<Object>() {};
    
              @Override
              public void add(Runnable runnable, Executor executor) {
                future.addListener(runnable, executor);
              }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Apr 17 15:19:38 GMT 2023
    - 20.4K 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 Apr 26 12:43:10 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 Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 9.1K bytes
    - Viewed (0)
  4. 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)
  5. 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)
  6. 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 Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Mar 22 03:01:34 GMT 2022
    - 6.5K bytes
    - Viewed (0)
  7. 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)
  8. guava-tests/test/com/google/common/util/concurrent/WrappingExecutorServiceTest.java

          List<Future<String>> futures = testExecutor.invokeAll(tasks);
          mock.assertLastMethodCalled("invokeAll");
          checkResults(futures);
        }
        {
          MockExecutor mock = new MockExecutor();
          TimeUnit unit = TimeUnit.SECONDS;
          long timeout = 5;
          TestExecutor testExecutor = new TestExecutor(mock);
          List<Future<String>> futures = testExecutor.invokeAll(tasks, timeout, unit);
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Jan 05 19:41:03 GMT 2023
    - 9.8K bytes
    - Viewed (0)
  9. guava-gwt/src-super/com/google/common/util/concurrent/super/com/google/common/util/concurrent/Uninterruptibles.java

    import java.util.concurrent.Future;
    import org.checkerframework.checker.nullness.qual.Nullable;
    
    /** Emulation of Uninterruptibles in GWT. */
    @ElementTypesAreNonnullByDefault
    public final class Uninterruptibles {
    
      private Uninterruptibles() {}
    
      @CanIgnoreReturnValue
      public static <V extends @Nullable Object> V getUninterruptibly(Future<V> future)
          throws ExecutionException {
        try {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Dec 08 20:30:27 GMT 2022
    - 1.3K bytes
    - Viewed (0)
  10. guava-gwt/src-super/com/google/common/util/concurrent/super/com/google/common/util/concurrent/AbstractFuture.java

      @CanIgnoreReturnValue
      protected boolean setFuture(ListenableFuture<? extends V> future) {
        checkNotNull(future);
    
        // If this future is already cancelled, cancel the delegate.
        // TODO(cpovirk): Should we do this at the end of the method, as in the server version?
        // TODO(cpovirk): Use maybePropagateCancellationTo?
        if (isCancelled()) {
          future.cancel(mayInterruptIfRunning);
        }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Jan 22 19:37:41 GMT 2024
    - 12.3K bytes
    - Viewed (0)
Back to top