Skip to content

Commit 070e209

Browse files
committed
Give caveats more prominence in asyncBytes documentation
1 parent e207f9d commit 070e209

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Sources/HuggingFace/Shared/URLSession+Linux.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,12 @@ import Foundation
134134

135135
/// Streams bytes from a URL request.
136136
///
137-
/// This provides a simplified streaming interface for Linux where `bytes(for:)` is not available.
138-
/// Note: This implementation buffers the entire response, so it's not suitable for very large responses.
139-
/// For true streaming on Linux, consider using a different HTTP client library.
137+
/// This provides a simplified streaming-like interface for Linux where `bytes(for:)` is not available.
138+
///
139+
/// - Important: This implementation **buffers the entire response in memory** before streaming bytes.
140+
/// It is **not** true streaming and is **not suitable for large responses or long‑lived streams**,
141+
/// as it may cause excessive memory usage.
142+
/// For true streaming on Linux, consider using a different HTTP client library.
140143
///
141144
/// - Parameter request: The URL request to perform.
142145
/// - Returns: A tuple containing the response bytes and URL response.

0 commit comments

Comments
 (0)