- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 11 for addCallback (0.13 sec)
-
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 Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Oct 21 15:41:36 UTC 2024 - 6.6K bytes - Viewed (0) -
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: * * <pre>{@code * final String name = ...; * inFlight.add(name); * ListenableFuture<Result> future = service.query(name);
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Jun 26 21:13:41 UTC 2023 - 8K bytes - Viewed (0) -
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: * * <pre>{@code * final String name = ...; * inFlight.add(name); * ListenableFuture<Result> future = service.query(name);
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Jun 26 21:13:41 UTC 2023 - 8K bytes - Viewed (0) -
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: * * <pre>{@code * final String name = ...; * inFlight.add(name); * ListenableFuture<Result> future = service.query(name);
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Jun 26 21:13:41 UTC 2023 - 8K bytes - Viewed (0) -
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 @ElementTypesAreNonnullByDefault public interface FutureCallback<V extends @Nullable Object> {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed May 05 22:27:35 UTC 2021 - 1.6K bytes - Viewed (0) -
guava/src/com/google/common/util/concurrent/FluentFuture.java
* @param executor The executor to run {@code callback} when the future completes. */ public final void addCallback(FutureCallback<? super V> callback, Executor executor) { Futures.addCallback(this, callback, executor); }
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 00:51:36 UTC 2024 - 19.6K bytes - Viewed (0) -
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")); final boolean[] called = new boolean[1]; f.addCallback( new FutureCallback<String>() { @Override public void onSuccess(String result) { called[0] = true; } @Override
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Tue Feb 13 14:28:25 UTC 2024 - 5.7K bytes - Viewed (0) -
android/guava/src/com/google/common/util/concurrent/Futures.java
* @since 10.0 */ public static <V extends @Nullable Object> void addCallback( final ListenableFuture<V> future, final 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 Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 25 13:13:32 UTC 2024 - 64.7K bytes - Viewed (0) -
guava/src/com/google/common/util/concurrent/Futures.java
* @since 10.0 */ public static <V extends @Nullable Object> void addCallback( final ListenableFuture<V> future, final 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 Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 25 13:13:32 UTC 2024 - 64.4K bytes - Viewed (0) -
guava/src/com/google/common/util/concurrent/MoreExecutors.java
* <li>If an exception propagates out of a {@code Runnable}, it is not necessarily seen by any * {@code UncaughtExceptionHandler} for the thread. For example, if the callback passed to * {@link Futures#addCallback} throws an exception, that exception will be typically be * logged by the {@link ListenableFuture} implementation, even if the thread is configured
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 00:51:36 UTC 2024 - 44.1K bytes - Viewed (0)