Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 94 for callables (0.2 sec)

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

          Callable<T> callable, ListeningExecutorService listeningExecutorService) {
        checkNotNull(callable);
        checkNotNull(listeningExecutorService);
        return () -> listeningExecutorService.submit(callable);
      }
    
      /**
       * Wraps the given callable such that for the duration of {@link Callable#call} the thread that is
       * running will have the given name.
       *
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri May 12 18:32:03 GMT 2023
    - 4.4K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/util/concurrent/CallablesTest.java

      public void testReturning() throws Exception {
        assertNull(Callables.returning(null).call());
    
        Object value = new Object();
        Callable<Object> callable = Callables.returning(value);
        assertSame(value, callable.call());
        // Expect the same value on subsequent calls
        assertSame(value, callable.call());
      }
    
      @J2ktIncompatible
      @GwtIncompatible
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/util/concurrent/WrappingExecutorServiceTest.java

        }
      }
    
      private static List<Callable<String>> createTasks(int n) {
        List<Callable<String>> callables = Lists.newArrayList();
        for (int i = 0; i < n; i++) {
          callables.add(Callables.returning(RESULT_VALUE + i));
        }
        return callables;
      }
    
      private static final class WrappedCallable<T> implements Callable<T> {
        private final Callable<T> delegate;
    
    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)
  4. android/guava-tests/test/com/google/common/cache/CacheExpirationTest.java

        CacheTesting.drainRecencyQueues(cache);
        ticker.advance(1, MILLISECONDS);
        assertThat(keySet).containsExactly(2, 3, 4, 5, 6, 7, 8, 9, 0);
    
        // get(K, Callable) doesn't stop 2 from expiring
        Integer unused = cache.get(2, Callables.returning(-2));
        CacheTesting.drainRecencyQueues(cache);
        ticker.advance(1, MILLISECONDS);
        assertThat(keySet).containsExactly(3, 4, 5, 6, 7, 8, 9, 0);
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Fri Aug 05 17:21:46 GMT 2022
    - 18.7K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/util/concurrent/FakeTimeLimiterTest.java

                        runnableThrowing(exception), DELAY_MS, TimeUnit.MILLISECONDS));
        assertThat(e.getCause()).isEqualTo(exception);
      }
    
      public static <T> Callable<T> callableThrowing(final Exception exception) {
        return new Callable<T>() {
          @Override
          public T call() throws Exception {
            throw exception;
          }
        };
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 4.2K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java

        List<Callable<T>> tasks = ImmutableList.of();
        List<? extends Future<?>> unused = executor.invokeAll(tasks);
      }
    
      public void testListeningDecorator() throws Exception {
        ListeningExecutorService service = listeningDecorator(newDirectExecutorService());
        assertSame(service, listeningDecorator(service));
        List<Callable<String>> callables = ImmutableList.of(Callables.returning("x"));
    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)
  7. guava-tests/test/com/google/common/util/concurrent/TrustedListenableFutureTaskTest.java

     * limitations under the License.
     */
    
    package com.google.common.util.concurrent;
    
    import static com.google.common.truth.Truth.assertThat;
    import static com.google.common.util.concurrent.Callables.returning;
    import static com.google.common.util.concurrent.Futures.getDone;
    import static com.google.common.util.concurrent.TestPlatform.verifyThreadWasNotInterrupted;
    
    import com.google.common.annotations.GwtCompatible;
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 7.3K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/cache/CacheExpirationTest.java

        CacheTesting.drainRecencyQueues(cache);
        ticker.advance(1, MILLISECONDS);
        assertThat(keySet).containsExactly(2, 3, 4, 5, 6, 7, 8, 9, 0);
    
        // get(K, Callable) doesn't stop 2 from expiring
        Integer unused = cache.get(2, Callables.returning(-2));
        CacheTesting.drainRecencyQueues(cache);
        ticker.advance(1, MILLISECONDS);
        assertThat(keySet).containsExactly(3, 4, 5, 6, 7, 8, 9, 0);
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Aug 05 17:21:46 GMT 2022
    - 18.7K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/util/concurrent/MoreExecutors.java

        return new WrappingExecutorService(service) {
          @Override
          protected <T extends @Nullable Object> Callable<T> wrapTask(Callable<T> callable) {
            return Callables.threadRenaming(callable, nameSupplier);
          }
    
          @Override
          protected Runnable wrapTask(Runnable command) {
            return Callables.threadRenaming(command, nameSupplier);
          }
        };
      }
    
      /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Apr 17 16:33:44 GMT 2024
    - 41.8K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/util/concurrent/TrustedListenableFutureTaskTest.java

     * limitations under the License.
     */
    
    package com.google.common.util.concurrent;
    
    import static com.google.common.truth.Truth.assertThat;
    import static com.google.common.util.concurrent.Callables.returning;
    import static com.google.common.util.concurrent.Futures.getDone;
    import static com.google.common.util.concurrent.TestPlatform.verifyThreadWasNotInterrupted;
    
    import com.google.common.annotations.GwtCompatible;
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 7.3K bytes
    - Viewed (0)
Back to top