parseq icon indicating copy to clipboard operation
parseq copied to clipboard

Support for andThen(Function1)?

Open hiteshsharma opened this issue 6 years ago • 1 comments

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.

hiteshsharma avatar Mar 21 '19 21:03 hiteshsharma

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

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

Anmol-Singh-Jaggi avatar Jun 14 '20 10:06 Anmol-Singh-Jaggi