Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 510 for Future (0.2 sec)

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

      @CanIgnoreReturnValue
      @ParametricNullness
      static <V extends @Nullable Object, X extends Exception> V getChecked(
          Future<V> future, Class<X> exceptionClass) throws X {
        return getChecked(bestGetCheckedTypeValidator(), future, exceptionClass);
      }
    
      /** Implementation of {@link Futures#getChecked(Future, Class)}. */
      @CanIgnoreReturnValue
      @VisibleForTesting
      @ParametricNullness
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Dec 14 20:35:03 GMT 2023
    - 10.3K bytes
    - Viewed (0)
  2. android/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 26 12:43:10 GMT 2024
    - Last Modified: Thu Jan 05 19:41:03 GMT 2023
    - 9.8K bytes
    - Viewed (0)
  3. 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)
  4. 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)
  5. guava-tests/test/com/google/common/util/concurrent/AbstractFutureTest.java

        InterruptibleFuture future = new InterruptibleFuture();
        assertTrue(future.cancel(false));
        assertTrue(future.isCancelled());
        assertTrue(future.isDone());
        assertFalse(future.wasInterrupted());
        assertFalse(future.interruptTaskWasCalled);
        CancellationException e = assertThrows(CancellationException.class, () -> future.get());
        assertThat(e).hasCauseThat().isNull();
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 46.8K bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. 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)
  9. guava-testlib/test/com/google/common/util/concurrent/testing/TestingExecutorsTest.java

                return taskDone;
              }
            };
        List<Future<Boolean>> futureList =
            executor.invokeAll(ImmutableList.of(task), 10, TimeUnit.MILLISECONDS);
        Future<Boolean> future = futureList.get(0);
        assertFalse(taskDone);
        assertTrue(future.isDone());
        assertThrows(CancellationException.class, () -> future.get());
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.7K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/util/concurrent/AbstractAbstractFutureTest.java

      private static void assertSetAsynchronously(AbstractFuture<Integer> future) {
        assertCannotSet(future);
        assertPending(future);
      }
    
      private static void assertPending(AbstractFuture<Integer> future) {
        assertThat(future.isDone()).isFalse();
        assertThat(future.isCancelled()).isFalse();
    
        CountingRunnable listener = new CountingRunnable();
        future.addListener(listener, directExecutor());
        listener.assertNotRun();
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 15.5K bytes
    - Viewed (0)
Back to top