Support SideEffect task that does not need any existing task.
mchen07 opened this issue · 1 comments
mchen07 commented
Currently, to fire and forget an async task that does not depend on any existing task, people are implementing this by using the ParSeq interface to return a Task.action that does nothing, and appending a side effect to it in order to spin off a thread that will by executed asynchronously.
We could improve API and provide Task.withSideEffect() that does not need any existing tasks to avoid boilerplate so:
Task.action(() -> { }).withSideEffect(response ->
Would become:
Task.withSideEffect(response ->