Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 773 for future (0.18 sec)

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

    @ElementTypesAreNonnullByDefault
    public interface FutureCallback<V extends @Nullable Object> {
      /** Invoked with the result of the {@code Future} computation when it is successful. */
      void onSuccess(@ParametricNullness V result);
    
      /**
       * Invoked when a {@code Future} computation fails or is canceled.
       *
       * <p>If the future's {@link Future#get() get} method throws an {@link ExecutionException}, then
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 05 22:27:35 GMT 2021
    - 1.6K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/util/concurrent/ListeningScheduledExecutorServiceTest.java

      public void testScheduleRunnable() throws Exception {
        Runnable command = () -> {};
    
        ListenableScheduledFuture<?> future = executorService.schedule(command, Duration.ofSeconds(12));
    
        assertThat(future.get()).isEqualTo("schedule");
        assertThat(recordedCommand).isSameInstanceAs(command);
        assertThat(recordedTimeUnit).isEqualTo(TimeUnit.NANOSECONDS);
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Mar 17 20:45:59 GMT 2020
    - 6.1K bytes
    - Viewed (0)
  3. 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)
  4. android/guava-tests/test/com/google/common/util/concurrent/FuturesGetCheckedTest.java

    import static com.google.common.util.concurrent.FuturesGetCheckedInputs.FAILED_FUTURE_ERROR;
    import static com.google.common.util.concurrent.FuturesGetCheckedInputs.FAILED_FUTURE_OTHER_THROWABLE;
    import static com.google.common.util.concurrent.FuturesGetCheckedInputs.FAILED_FUTURE_UNCHECKED_EXCEPTION;
    import static com.google.common.util.concurrent.FuturesGetCheckedInputs.OTHER_THROWABLE;
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 16.4K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/util/concurrent/FutureCallbackTest.java

              }
    
              @Override
              public void onFailure(Throwable t) {
                failureCalls[0]++;
              }
            };
        addCallback(future, callback, directExecutor());
        future.set(result);
        assertEquals(result, future.get());
        assertThat(successCalls[0]).isEqualTo(1);
        assertThat(failureCalls[0]).isEqualTo(0);
      }
    
      public void testOnSuccessThrowsError() throws Exception {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Nov 15 16:33:21 GMT 2022
    - 6.3K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/util/concurrent/AbstractCatchingFuture.java

          Class<X> exceptionType,
          Function<? super X, ? extends V> fallback,
          Executor executor) {
        CatchingFuture<V, X> future = new CatchingFuture<>(input, exceptionType, fallback);
        input.addListener(future, rejectionPropagatingExecutor(executor, future));
        return future;
      }
    
      static <X extends Throwable, V extends @Nullable Object> ListenableFuture<V> create(
          ListenableFuture<? extends V> input,
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 01 21:46:34 GMT 2024
    - 8.7K bytes
    - Viewed (0)
  7. 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)
  8. 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)
  9. guava-tests/test/com/google/common/util/concurrent/TestPlatform.java

      }
    
      /**
       * Retrieves the result of a {@code Future} known to be done but uses the {@code get(long,
       * TimeUnit)} overload in order to test that method.
       */
      static <V> V getDoneFromTimeoutOverload(Future<V> future) throws ExecutionException {
        checkState(future.isDone(), "Future was expected to be done: %s", future);
        try {
          return getUninterruptibly(future, 0, SECONDS);
        } catch (TimeoutException e) {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2.9K bytes
    - Viewed (0)
  10. 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)
Back to top