Repository navigation
feat(pi): stream pi durable conversations to clients - #323
Merged
Conversation
This was referenced Oct 5, 2026
eersnington
force-pushed
the
stack/feat-pi-add-pidurable-actor-zlmoklxm
branch
from
October 5, 2026 09:54
6f798ee to
d19db6a
Compare
eersnington
force-pushed
the
stack/feat-pi-stream-pi-durable-conversations-to-clients-rvqykpzv
branch
from
October 5, 2026 09:54
0a0ab0e to
0bfc39b
Compare
eersnington
force-pushed
the
stack/feat-pi-add-pidurable-actor-zlmoklxm
branch
from
October 5, 2026 18:53
d19db6a to
a8731a7
Compare
eersnington
force-pushed
the
stack/feat-pi-stream-pi-durable-conversations-to-clients-rvqykpzv
branch
from
October 5, 2026 18:53
0bfc39b to
9657e88
Compare
eersnington
merged commit Oct 5, 2026
93bf3de
into
stack/feat-pi-add-pidurable-actor-zlmoklxm
0 of 3 checks passed
eersnington
deleted the
stack/feat-pi-stream-pi-durable-conversations-to-clients-rvqykpzv
branch
October 5, 2026 19:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clients can follow a conversation live. Each watch action returns the current value and then streams frames to the calling connection only.
conversation.watchEvents(cid){ snapshot }pi.eventsbatches of agent eventsconversation.watch(cid){ value }: the conversation viewpi.viewChord opsharness.watchTaskGraph(){ value }pi.taskGraphChord opsharness.watchDoc(kind, cid){ value }, orundefinedbefore the document existspi.docwith the whole valueEach has an
unwatch*counterpart.sequenceDiagram participant C as Client participant A as Actor C->>A: watchEvents(1) A-->>C: { snapshot } (frame 0) A->>C: pi.events seq 1, 2, 3 ... Note over A: actor sleeps, connection hibernates A->>C: on wake: pi.events seq 0 with a fresh snapshot A->>C: seq 1, 2 ...seqcounts frames per watch. A client that sees a gap calls the watch action again. Nothing is replayed, as in Pi Durable and Cloudflare.pi_durable_watch. On wake, connections that are still open get their watches back with aseq0 snapshot. This needs fix(rivetkit): stop hibernating actor connections by default rivet#5835, which delivers events sent fromonWake.onDisconnectends every watch of the connection.connect()for frames.This is part 4 of 11 in a stack: