Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions pkg-py/src/shinychat/_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,12 @@ async def on_response(self) -> None:
The server-side message accumulator and recorded turns are read before
writing the record. Reads and writes are separated by awaits
(``store.put``, eviction, bookmark mint), but this is safe without an
explicit lock because Shiny serializes reactive flushes behind a
single process-wide ``reactive.lock()`` for the full duration of
effect execution.
explicit lock. Shiny never starts a run of an effect while its previous
run is still going, so two calls from ``_save_on_response`` can't
overlap. The other effects that change ``self.record`` are triggered by
client inputs, and Shiny holds input changes until all of the session's
effects have finished, so they can't run while this one is paused at an
``await``.
"""
if self.partition is None:
raise RuntimeError("HistoryController not initialized")
Expand Down
Loading