You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9b94ad6
Browse filesBrowse the repository at this point in the historyBrowse files
Port data stream writers to FFI writer handles; add streamText/streamBytes
TextStreamWriter / ByteStreamWriter now open an FFI writer
(text/byte_stream_open) and send through text/byte_stream_write and
*_stream_close instead of hand-built header/chunk/trailer packets. Rust does
the chunking and UTF-8 splitting.
- LocalParticipant::streamText / streamBytes return an already-open writer
(blocking until the open callback, throwing DataStreamError on failure).
The public writer constructors keep working but are deprecated; they open
lazily on the first write or close, as the header did before.
- write() and close() share one mutex and each waits for its FFI callback,
so a close never overtakes an in-flight write (python-sdks#879); this also
fixes close() not taking the write lock.
- A LocalParticipant tracks its writers in a registry shared with them. On
disconnect (or participant destruction) every writer is closed and its
handle dropped, so later write/close throw DataStreamError instead of
reaching an FFI session that would panic.
- A writer destroyed without close() sends a non-waiting FFI close. Rust's
writer only sends its drop-time trailer from a Tokio thread, so a plain
handle drop from C++ left receivers waiting forever.
- kStreamChunkSize and the protected ensureHeaderSent / sendChunk /
sendTrailer helpers are deprecated and reimplemented on the new path.
- Removed FfiClient::sendStream*Async, splitUtf8 and the now-unused
header/chunk/trailer converters.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: AGENTS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,7 +78,7 @@ All `RoomDelegate` callbacks and stream handler callbacks (e.g., `registerTextSt
78
78
|`LocalDataTrack::tryPush`| No | Thin `sendRequest` wrapper with no internal synchronization. |
79
79
|`TextStreamReader` / `ByteStreamReader`| Yes | Fed on the FFI callback thread, read on a user thread (internal `std::mutex` + `condition_variable`). End-of-stream attributes are merged into `info()` on the reading thread, so don't call `info()` concurrently with `readNext()`. |
80
80
|`LocalParticipant::sendText` / `sendBytes` / `sendFile`| Yes | Independent async FFI requests; each call blocks its caller until its own callback arrives. They throw `DataStreamError` once the room has disconnected rather than reaching the FFI. |
81
-
|`TextStreamWriter` / `ByteStreamWriter`| Serialized |`write()`is serialized by an internal `write_mutex_`. |
81
+
|`TextStreamWriter` / `ByteStreamWriter`| Serialized |`write()`and `close()` are serialized by an internal mutex and each waits for its FFI callback, so `close()` never overtakes a write. `LocalParticipant` closes its writers on disconnect (via a shared registry, so writers may outlive the participant); later calls throw `DataStreamError`. Create writers with `LocalParticipant::streamText` / `streamBytes`; the constructors are deprecated. |
82
82
83
83
### Directory Layout
84
84
Be sure to update the directory layout in this file if the directory layout changes.
0 commit comments