Skip to content
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

Support for andThen(Function1)? #207

Open
hiteshsharma opened this issue Mar 21, 2019 · 1 comment
Open

Support for andThen(Function1)? #207

hiteshsharma opened this issue Mar 21, 2019 · 1 comment

Comments

@hiteshsharma
Copy link
Contributor

Hi,

Currently, if a Task needs to be executed after a task, sequentially, then andThen(Task<R> task) needs to be used.
This introduces a few issues where if code is like andThen(someTaskReturningFunction()) then someTaskReturningFunction() will get executed though the Task returned by it may not be run.
Should a andThen(Function1 func) be supported to allow sequential execution of a task after a parent task by also ensuring the task supplying argument is not invoked.
This will be close to withSideEffect but sometimes, andThen is more suited for the use case.

@Anmol-Singh-Jaggi
Copy link
Contributor

"though the Task returned by it may not be run"

Why would it not run?
Can you give an example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants