Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for FutureCallback (0.09 sec)

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

     * 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. */
      void onSuccess(@ParametricNullness V result);
    
      /**
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sun Dec 22 03:38:46 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  2. guava/src/com/google/common/util/concurrent/FutureCallback.java

     * 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. */
      void onSuccess(@ParametricNullness V result);
    
      /**
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sun Dec 22 03:38:46 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/util/concurrent/FutureCallbackTest.java

        addCallback(f, callback, directExecutor());
        f.setException(e);
      }
    
      public void testCancel() {
        SettableFuture<String> f = SettableFuture.create();
        FutureCallback<String> callback =
            new FutureCallback<String>() {
              private final Object monitor = new Object();
              private boolean called = false;
    
              @Override
              public void onSuccess(String result) {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Jul 14 14:44:08 UTC 2025
    - 6.7K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/util/concurrent/FutureCallbackTest.java

        addCallback(f, callback, directExecutor());
        f.setException(e);
      }
    
      public void testCancel() {
        SettableFuture<String> f = SettableFuture.create();
        FutureCallback<String> callback =
            new FutureCallback<String>() {
              private final Object monitor = new Object();
              private boolean called = false;
    
              @Override
              public void onSuccess(String result) {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Jul 14 14:44:08 UTC 2025
    - 6.7K bytes
    - Viewed (0)
  5. regression-test/src/androidTest/java/okhttp/regression/compare/ApacheHttpClientHttp2Test.kt

    import org.apache.hc.client5.http.async.methods.SimpleHttpRequests
    import org.apache.hc.client5.http.async.methods.SimpleHttpResponse
    import org.apache.hc.client5.http.impl.async.HttpAsyncClients
    import org.apache.hc.core5.concurrent.FutureCallback
    import org.apache.hc.core5.http.ProtocolVersion
    import org.junit.Assert
    import org.junit.Test
    
    /**
     * Simplified from
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  6. guava-gwt/src-super/com/google/common/util/concurrent/super/com/google/common/util/concurrent/ListenableFuture.java

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

      }
    
      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
              public void onFailure(Throwable t) {}
            },
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 5.8K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/util/concurrent/Futures.java

      public static <V extends @Nullable Object> void addCallback(
          ListenableFuture<V> future, FutureCallback<? super V> callback, Executor executor) {
        Preconditions.checkNotNull(callback);
        future.addListener(new CallbackListener<V>(future, callback), executor);
      }
    
      /** See {@link #addCallback(ListenableFuture, FutureCallback, Executor)} for behavioral notes. */
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 64.3K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/util/concurrent/FluentFuture.java

       * callbacks, but any callback added through this method is guaranteed to be called once the
       * computation is complete.
       *
       * <p>Example:
       *
       * {@snippet :
       * future.addCallback(
       *     new FutureCallback<QueryResult>() {
       *       public void onSuccess(QueryResult result) {
       *         storeInCache(result);
       *       }
       *       public void onFailure(Throwable t) {
       *         reportError(t);
       *       }
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 19.7K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/util/concurrent/ClosingFuture.java

        checkNotNull(closingExecutor);
        ClosingFuture<C> closingFuture = new ClosingFuture<>(nonCancellationPropagating(future));
        Futures.addCallback(
            future,
            new FutureCallback<@Nullable AutoCloseable>() {
              @Override
              public void onSuccess(@Nullable AutoCloseable result) {
                closingFuture.closeables.closer.eventuallyClose(result, closingExecutor);
              }
    
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Wed Jul 23 15:26:56 UTC 2025
    - 97.8K bytes
    - Viewed (0)
Back to top