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:
parent
99da637633
commit
dd13277195
1 changed files with 3 additions and 1 deletions
|
|
@ -134,7 +134,9 @@ public interface StashingExample {
|
||||||
private Effect<Event, State> onEndTask(State state, EndTask command) {
|
private Effect<Event, State> onEndTask(State state, EndTask command) {
|
||||||
if (state.taskIdInProgress.isPresent()) {
|
if (state.taskIdInProgress.isPresent()) {
|
||||||
if (state.taskIdInProgress.get().equals(command.taskId))
|
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().stash(); // other task in progress, wait with new task until later
|
||||||
} else {
|
} else {
|
||||||
return Effect().unhandled();
|
return Effect().unhandled();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue