Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for callWithTimeout (0.51 sec)

  1. android/guava-tests/test/com/google/common/util/concurrent/FakeTimeLimiterTest.java

        super.setUp();
        timeLimiter = new FakeTimeLimiter();
      }
    
      public void testCallWithTimeout_propagatesReturnValue() throws Exception {
        String result =
            timeLimiter.callWithTimeout(
                Callables.returning(RETURN_VALUE), DELAY_MS, TimeUnit.MILLISECONDS);
    
        assertThat(result).isEqualTo(RETURN_VALUE);
      }
    
      public void testCallWithTimeout_wrapsCheckedException() throws Exception {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 4.2K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/util/concurrent/FakeTimeLimiterTest.java

        super.setUp();
        timeLimiter = new FakeTimeLimiter();
      }
    
      public void testCallWithTimeout_propagatesReturnValue() throws Exception {
        String result =
            timeLimiter.callWithTimeout(
                Callables.returning(RETURN_VALUE), DELAY_MS, TimeUnit.MILLISECONDS);
    
        assertThat(result).isEqualTo(RETURN_VALUE);
      }
    
      public void testCallWithTimeout_wrapsCheckedException() throws Exception {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 4.2K bytes
    - Viewed (0)
  3. guava/src/com/google/common/util/concurrent/SimpleTimeLimiter.java

                      } catch (InvocationTargetException e) {
                        throw throwCause(e, false /* combineStackTraces */);
                      }
                    };
                return callWithTimeout(
                    callable, timeoutDuration, timeoutUnit, interruptibleMethods.contains(method));
              }
            };
        return newProxy(interfaceType, handler);
      }
    
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue Jun 27 14:21:11 UTC 2023
    - 9.7K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/util/concurrent/FakeTimeLimiter.java

        checkNotNull(timeoutUnit);
        return target; // ha ha
      }
    
      @CanIgnoreReturnValue // TODO(kak): consider removing this
      @Override
      @ParametricNullness
      public <T extends @Nullable Object> T callWithTimeout(
          Callable<T> callable, long timeoutDuration, TimeUnit timeoutUnit) throws ExecutionException {
        checkNotNull(callable);
        checkNotNull(timeoutUnit);
        try {
          return callable.call();
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Dec 14 20:35:03 UTC 2023
    - 3.5K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/util/concurrent/SimpleTimeLimiterTest.java

        assertThrows(
            TimeoutException.class,
            () -> service.callWithTimeout(GOOD_CALLABLE, NOT_ENOUGH_MS, MILLISECONDS));
      }
    
      public void testCallWithTimeout_badCallableWithEnoughTime() throws Exception {
        ExecutionException expected =
            assertThrows(
                ExecutionException.class,
                () -> service.callWithTimeout(BAD_CALLABLE, ENOUGH_MS, MILLISECONDS));
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 9.5K bytes
    - Viewed (0)
  6. guava/src/com/google/common/util/concurrent/FakeTimeLimiter.java

        checkNotNull(timeoutUnit);
        return target; // ha ha
      }
    
      @CanIgnoreReturnValue // TODO(kak): consider removing this
      @Override
      @ParametricNullness
      public <T extends @Nullable Object> T callWithTimeout(
          Callable<T> callable, long timeoutDuration, TimeUnit timeoutUnit) throws ExecutionException {
        checkNotNull(callable);
        checkNotNull(timeoutUnit);
        try {
          return callable.call();
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Dec 14 20:35:03 UTC 2023
    - 3.5K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/util/concurrent/SimpleTimeLimiterTest.java

        assertThrows(
            TimeoutException.class,
            () -> service.callWithTimeout(GOOD_CALLABLE, NOT_ENOUGH_MS, MILLISECONDS));
      }
    
      public void testCallWithTimeout_badCallableWithEnoughTime() throws Exception {
        ExecutionException expected =
            assertThrows(
                ExecutionException.class,
                () -> service.callWithTimeout(BAD_CALLABLE, ENOUGH_MS, MILLISECONDS));
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 9.5K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/util/concurrent/SimpleTimeLimiter.java

                      } catch (InvocationTargetException e) {
                        throw throwCause(e, false /* combineStackTraces */);
                      }
                    };
                return callWithTimeout(
                    callable, timeoutDuration, timeoutUnit, interruptibleMethods.contains(method));
              }
            };
        return newProxy(interfaceType, handler);
      }
    
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue Jun 27 14:21:11 UTC 2023
    - 9.7K bytes
    - Viewed (0)
  9. guava/src/com/google/common/util/concurrent/TimeLimiter.java

       * @since 28.0
       */
      @CanIgnoreReturnValue
      @ParametricNullness
      default <T extends @Nullable Object> T callWithTimeout(Callable<T> callable, Duration timeout)
          throws TimeoutException, InterruptedException, ExecutionException {
        return callWithTimeout(callable, toNanosSaturated(timeout), TimeUnit.NANOSECONDS);
      }
    
      /**
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Fri May 12 18:32:03 UTC 2023
    - 15.3K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/util/concurrent/TimeLimiter.java

       * @throws ExecutionError if {@code callable} throws an {@code Error}
       * @since 22.0
       */
      @CanIgnoreReturnValue
      @ParametricNullness
      <T extends @Nullable Object> T callWithTimeout(
          Callable<T> callable, long timeoutDuration, TimeUnit timeoutUnit)
          throws TimeoutException, InterruptedException, ExecutionException;
    
      /**
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Fri May 12 18:32:03 UTC 2023
    - 8.3K bytes
    - Viewed (0)
Back to top