New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add future callback overloads with executor #709

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@dain
Copy link
Member

dain commented Feb 5, 2019

Add overloaded versions of addSuccessCallback and addExceptionCallback that take an executor.

Add future callback overloads with executor
Add overloaded versions of addSuccessCallback and addExceptionCallback that
take an executor.
@findepi

findepi approved these changes Feb 5, 2019

@@ -494,6 +495,11 @@ public void onFailure(Throwable t)
}

public static <T> void addSuccessCallback(ListenableFuture<T> future, Consumer<T> successCallback)

This comment has been minimized.

@nezihyigitbasi

nezihyigitbasi Feb 5, 2019

Collaborator

It would be nice to add some javadoc here that mentions that direct executor will be used here, and the consequences of that.

@@ -509,17 +515,27 @@ public void onSuccess(@Nullable T result)
@Override
public void onFailure(Throwable t) {}
};
Futures.addCallback(future, callback, directExecutor());
Futures.addCallback(future, callback, executor);
}

public static <T> void addSuccessCallback(ListenableFuture<T> future, Runnable successCallback)

This comment has been minimized.

@nezihyigitbasi

nezihyigitbasi Feb 5, 2019

Collaborator

ditto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment