Skip to content

Commit 9fe413b

Browse files
committed
Clarify looping over AsyncSequence in file reading example
1 parent e673b25 commit 9fe413b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/advanced/files.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ let readComplete: EventLoopFuture<Void> = req.fileio.readFile(at: "/path/to/file
1515
// Or
1616

1717
let file = try await request.fileio.readFile(at: path, chunkSize: 16 * 1024) // 32Kb, ~5 chunks
18-
18+
for try await chunk in file {
19+
readContent += String(buffer: chunk) //converting chunks into string
20+
}
21+
print(readContent)
22+
1923
// Read is complete
2024
```
2125

0 commit comments

Comments
 (0)