simple = Workflow::newActivityStub( SimpleActivity::class, ActivityOptions::new()->withStartToCloseTimeout(5) ); } #[SignalMethod] public function addValue( string $value ) { $this->values[] = $value; } #[WorkflowMethod(name: 'LoopWorkflow')] public function run( int $count ) { while (true) { yield Workflow::await(fn() => $this->values !== []); $value = array_shift($this->values); $this->result[] = yield $this->simple->echo($value); if (count($this->result) === $count) { break; } } return $this->result; } }