99public import Std.Sync
1010public import Init.Data.Vector
1111public import Std.Internal.Async
12- public import Std.Internal.Async.IO
1312public import Std.Internal.Http.Internal
1413public import Std.Internal.Http.Data.Chunk
1514public import Std.Internal.Http.Data.Body.Length
@@ -19,9 +18,9 @@ public section
1918/-!
2019# ByteStream
2120
22- This module defines the `ByteStream` structure, which represents a channel for reading and
23- writing sequences of bytes. It provides utilities for efficiently processing byte arrays
24- in a streaming fashion, including support for chunk extensions .
21+ A `ByteStream` represents an asynchronous channel for streaming byte data in chunks. It provides an
22+ interface for producers and consumers to exchange byte arrays with optional chunk metadata (extensions),
23+ aking it suitable for HTTP chunked transfer encoding and other streaming scenarios .
2524-/
2625
2726namespace Std.Http.Body
@@ -55,16 +54,14 @@ def empty : Async ByteStream :=
5554 emptyWithCapacity
5655
5756/--
58- Tries to receive a chunk from the stream.
59- Returns `some` with a chunk when data is available, or `none` when the stream is closed
60- or no data is available.
57+ Tries to receive a chunk from the stream. Returns `some` with a chunk when data is available, or `none`
58+ hen the stream is closed or no data is available.
6159-/
6260def tryRecv (stream : ByteStream) : Async (Option Chunk) := do
6361 stream.channel.tryRecv
6462
6563/--
66- Receives (reads) a chunk from the stream.
67- Returns `none` if the stream is closed and no data is available.
64+ Receives (reads) a chunk from the stream. Returns `none` if the stream is closed and no data is available.
6865-/
6966def recv (stream : ByteStream) : Async (Option Chunk) := do
7067 let task ← stream.channel.recv
0 commit comments