I have, roughly:
#[UpdateMethod]
public function getProgress(): \Generator|array {
$return = $this->progress;
$this->progress = [];
return $return;
}
#[WorkflowMethod]
public function run(): \Generator {
$activity = Workflow::newActivityStub();
$this->progress = yield $activity->do();
}
Is the following mental model correct:
Workflow task:
schedule activity
yield
Workflow suspended
Update arrives:
replay workflow
execute update handler
return progress
Activity completes:
replay workflow
continue execution
Most importantly, is it correct that Update can only run when the WorkflowMethod hands back control with a yield?