There was an error while loading. Please reload this page.
1 parent 6d5c62f commit 20ab029Copy full SHA for 20ab029
1 file changed
user_guide_src/source/outgoing/response/040.php
@@ -2,9 +2,8 @@
2
3
// Any iterable of string chunks works, including generators.
4
$chunks = static function (): \Generator {
5
- foreach (model('LogModel')->findAll() as $log) {
6
- yield json_encode($log) . "\n";
7
- }
+ yield json_encode(['event' => 'started']) . "\n";
+ yield json_encode(['event' => 'finished']) . "\n";
8
};
9
10
return $this->response->stream($chunks());
0 commit comments