parseq
parseq copied to clipboard
Support for andThen(Function1)?
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.
"though the Task returned by it may not be run"
Why would it not run? Can you give an example?