Skip to content

Commit 20ab029

Browse files
committed
update user guide example
1 parent 6d5c62f commit 20ab029

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

  • user_guide_src/source/outgoing/response

user_guide_src/source/outgoing/response/040.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
// Any iterable of string chunks works, including generators.
44
$chunks = static function (): \Generator {
5-
foreach (model('LogModel')->findAll() as $log) {
6-
yield json_encode($log) . "\n";
7-
}
5+
yield json_encode(['event' => 'started']) . "\n";
6+
yield json_encode(['event' => 'finished']) . "\n";
87
};
98

109
return $this->response->stream($chunks());

0 commit comments

Comments
 (0)