Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for addCallback (0.06 sec)

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

        MockCallback callback = new MockCallback("foo");
        addCallback(f, callback, directExecutor());
        f.set("foo");
      }
    
      public void testExecutorSuccess() {
        CountingSameThreadExecutor ex = new CountingSameThreadExecutor();
        SettableFuture<String> f = SettableFuture.create();
        MockCallback callback = new MockCallback("foo");
        Futures.addCallback(f, callback, ex);
        f.set("foo");
        assertEquals(1, ex.runCount);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Jul 14 14:44:08 UTC 2025
    - 6.7K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/util/concurrent/FutureCallbackTest.java

        MockCallback callback = new MockCallback("foo");
        addCallback(f, callback, directExecutor());
        f.set("foo");
      }
    
      public void testExecutorSuccess() {
        CountingSameThreadExecutor ex = new CountingSameThreadExecutor();
        SettableFuture<String> f = SettableFuture.create();
        MockCallback callback = new MockCallback("foo");
        Futures.addCallback(f, callback, ex);
        f.set("foo");
        assertEquals(1, ex.runCount);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Jul 14 14:44:08 UTC 2025
    - 6.7K bytes
    - Viewed (0)
  3. futures/listenablefuture1/src/com/google/common/util/concurrent/ListenableFuture.java

     * rarely use it directly, in part because it does not provide direct access to the {@code Future}
     * result. (If you want such access, you may prefer {@link Futures#addCallback
     * Futures.addCallback}.) Still, direct {@code addListener} calls are occasionally useful:
     *
     * {@snippet :
     * final String name = ...;
     * inFlight.add(name);
     * ListenableFuture<Result> future = service.query(name);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Mar 17 20:26:29 UTC 2025
    - 8K bytes
    - Viewed (0)
  4. guava/src/com/google/common/util/concurrent/ListenableFuture.java

     * rarely use it directly, in part because it does not provide direct access to the {@code Future}
     * result. (If you want such access, you may prefer {@link Futures#addCallback
     * Futures.addCallback}.) Still, direct {@code addListener} calls are occasionally useful:
     *
     * {@snippet :
     * final String name = ...;
     * inFlight.add(name);
     * ListenableFuture<Result> future = service.query(name);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Mar 17 20:26:29 UTC 2025
    - 8K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/util/concurrent/ListenableFuture.java

     * rarely use it directly, in part because it does not provide direct access to the {@code Future}
     * result. (If you want such access, you may prefer {@link Futures#addCallback
     * Futures.addCallback}.) Still, direct {@code addListener} calls are occasionally useful:
     *
     * {@snippet :
     * final String name = ...;
     * inFlight.add(name);
     * ListenableFuture<Result> future = service.query(name);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Mar 17 20:26:29 UTC 2025
    - 8K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/util/concurrent/FluentFutureTest.java

        // TODO(cpovirk): Test forwarding more extensively.
      }
    
      public void testAddCallback() {
        FluentFuture<String> f = FluentFuture.from(immediateFuture("a"));
        boolean[] called = new boolean[1];
        f.addCallback(
            new FutureCallback<String>() {
              @Override
              public void onSuccess(String result) {
                called[0] = true;
              }
    
              @Override
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 5.8K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/util/concurrent/FutureCallback.java

    /**
     * A callback for accepting the results of a {@link java.util.concurrent.Future} computation
     * asynchronously.
     *
     * <p>To attach to a {@link ListenableFuture} use {@link Futures#addCallback}.
     *
     * @author Anthony Zana
     * @since 10.0
     */
    @GwtCompatible
    public interface FutureCallback<V extends @Nullable Object> {
      /** Invoked with the result of the {@code Future} computation when it is successful. */
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sun Dec 22 03:38:46 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  8. guava-gwt/src-super/com/google/common/util/concurrent/super/com/google/common/util/concurrent/ListenableFuture.java

          @JsOptional @Nullable IThenOnRejectedCallbackFn<? extends R> onRejected) {
        return new Promise<V>(
                (resolve, reject) -> {
                  Futures.addCallback(
                      this,
                      new FutureCallback<V>() {
                        @Override
                        public void onSuccess(V value) {
                          resolve.onInvoke(value);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sun Dec 22 03:38:46 UTC 2024
    - 3.8K bytes
    - Viewed (0)
  9. guava/src/com/google/common/util/concurrent/FutureCallback.java

    /**
     * A callback for accepting the results of a {@link java.util.concurrent.Future} computation
     * asynchronously.
     *
     * <p>To attach to a {@link ListenableFuture} use {@link Futures#addCallback}.
     *
     * @author Anthony Zana
     * @since 10.0
     */
    @GwtCompatible
    public interface FutureCallback<V extends @Nullable Object> {
      /** Invoked with the result of the {@code Future} computation when it is successful. */
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sun Dec 22 03:38:46 UTC 2024
    - 1.5K bytes
    - Viewed (0)
Back to top