Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 74 for Listener (0.15 sec)

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

        queue.enqueue(incrementingEvent(counters, listener1, 1));
        queue.enqueue(incrementingEvent(counters, listener1, 2));
    
        Object listener2 = new Object();
        queue.addListener(listener2, directExecutor());
        queue.enqueue(incrementingEvent(counters, multiset(listener1, 3, listener2, 1)));
        queue.enqueue(incrementingEvent(counters, multiset(listener1, 4, listener2, 2)));
        assertEquals(0, counters.size());
        queue.dispatch();
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 8.2K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/cache/NullCacheTest.java

      QueuingRemovalListener<Object, Object> listener;
    
      @Override
      protected void setUp() {
        listener = queuingRemovalListener();
      }
    
      public void testGet() {
        Object computed = new Object();
        LoadingCache<Object, Object> cache =
            CacheBuilder.newBuilder()
                .maximumSize(0)
                .removalListener(listener)
                .build(constantLoader(computed));
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 4.4K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/util/concurrent/AbstractServiceTest.java

          throw exception;
        }
      }
    
      private static class RecordingListener extends Listener {
        static RecordingListener record(Service service) {
          RecordingListener listener = new RecordingListener(service);
          service.addListener(listener, directExecutor());
          return listener;
        }
    
        final Service service;
    
        RecordingListener(Service service) {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 29.3K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/util/concurrent/AbstractAbstractFutureTest.java

        CountingRunnable listener = new CountingRunnable();
    
        future.addListener(listener, directExecutor());
        listener.assertNotRun();
    
        future.set(1);
        listener.assertRun();
      }
    
      public void testListenLaterFailed() {
        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)
  5. android/guava-testlib/src/com/google/common/util/concurrent/testing/MockFutureListener.java

      }
    
      /**
       * Verify that the listener completes in a reasonable amount of time, and Asserts that the future
       * returns the expected data.
       *
       * @throws Throwable if the listener isn't called or if it resulted in a throwable or if the
       *     result doesn't match the expected value.
       */
      public void assertSuccess(Object expectedData) throws Throwable {
        // Verify that the listener executed in a reasonable amount of time.
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Fri May 12 18:12:42 GMT 2023
    - 3K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/util/concurrent/AbstractService.java

      private static final ListenerCallQueue.Event<Listener> STARTING_EVENT =
          new ListenerCallQueue.Event<Listener>() {
            @Override
            public void call(Listener listener) {
              listener.starting();
            }
    
            @Override
            public String toString() {
              return "starting()";
            }
          };
      private static final ListenerCallQueue.Event<Listener> RUNNING_EVENT =
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri May 12 18:32:03 GMT 2023
    - 20.4K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/util/concurrent/ImmediateFuture.java

      }
    
      @Override
      @SuppressWarnings("CatchingUnchecked") // sneaky checked exception
      public void addListener(Runnable listener, Executor executor) {
        checkNotNull(listener, "Runnable was null.");
        checkNotNull(executor, "Executor was null.");
        try {
          executor.execute(listener);
        } catch (Exception e) { // sneaky checked exception
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Dec 13 19:45:20 GMT 2023
    - 3.5K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/util/concurrent/ListenableFuture.java

      /**
       * Registers a listener to be {@linkplain Executor#execute(Runnable) run} on the given executor.
       * The listener will run when the {@code Future}'s computation is {@linkplain Future#isDone()
       * complete} or, if the computation is already complete, immediately.
       *
       * <p>There is no guaranteed ordering of execution of listeners, but any listener added through
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Jun 26 21:13:41 GMT 2023
    - 8K bytes
    - Viewed (0)
  9. android/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java

      private CountDownLatch listenerLatch;
      private ExecutionListWrapper list;
    
      @Param Impl impl;
    
      @Param({"1", "5", "10"})
      int numListeners;
    
      private final Runnable listener =
          new Runnable() {
            @Override
            public void run() {
              listenerLatch.countDown();
            }
          };
    
      @BeforeExperiment
      void setUp() throws Exception {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Apr 17 15:19:38 GMT 2023
    - 20.4K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/util/concurrent/AbstractFuture.java

          while (true) {
            Listener listener = future.listeners;
            if (update == listener) {
              return listener;
            }
            if (casListeners(future, listener, update)) {
              return listener;
            }
          }
        }
    
        /** Performs a GAS operation on the {@link #waiters} field. */
        @Override
        Waiter gasWaiters(AbstractFuture<?> future, Waiter update) {
          while (true) {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 22 21:17:24 GMT 2024
    - 63K bytes
    - Viewed (0)
Back to top