add missing thenUnstashAll call (#30305)

Add the missing `unstash` so that the next task would continue after a task successfully completed.
This commit is contained in:
Michael Rose 2021-06-21 14:49:31 +02:00 committed by GitHub
parent 99da637633
commit dd13277195
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -134,7 +134,9 @@ public interface StashingExample {
private Effect<Event, State> onEndTask(State state, EndTask command) {
if (state.taskIdInProgress.isPresent()) {
if (state.taskIdInProgress.get().equals(command.taskId))
return Effect().persist(new TaskCompleted(command.taskId));
return Effect()
.persist(new TaskCompleted(command.taskId))
.thenUnstashAll(); // continue with next task
else return Effect().stash(); // other task in progress, wait with new task until later
} else {
return Effect().unhandled();