Support for andThen(Function1)?
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 268
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
Currently, if a `Task` needs to be executed after a task, sequentially, then `andThen(Task 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.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating Task and the existing andThen(Task task) and withSideEffect APIs. Compare their execution behavior with the proposed andThen(Function1) overload; done means the function is not invoked until the parent task completes and its returned task can then execute sequentially.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100