Skip to content

chore: add backed reader, writer and pipe implementation - #19147

Merged
ibetitsmike merged 18 commits into
mainfrom
mike/immortal-streams-backed-base
Sep 11, 2025
Merged

ibetitsmike merged 18 commits into
mainfrom
mike/immortal-streams-backed-base

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Aug 4, 2025 •

Copy link
Copy Markdown
Collaborator

Fixes: #19977

This PR introduces a new backedpipe package that provides reliable bidirectional byte streams over unreliable network connections. The implementation includes:

  • BackedPipe: Orchestrates a reader and writer to provide transparent reconnection and data replay
  • BackedReader: Handles reading with automatic reconnection, blocking reads when disconnected
  • BackedWriter: Maintains a ring buffer of recent writes for replay during reconnection
  • RingBuffer: Efficient circular buffer implementation for storing data

The package enables resilient connections by tracking sequence numbers and replaying missed data after reconnection. It handles connection failures gracefully, automatically reconnecting and resuming data transfer from the appropriate point.

ibetitsmike commented Aug 4, 2025 •

Copy link
Copy Markdown
Collaborator Author

@ibetitsmike ibetitsmike changed the title backed reader, writer and pipe implementation chore: add backed reader, writer and pipe implementation Aug 5, 2025
@ibetitsmike
ibetitsmike force-pushed the mike/immortal-streams-backed-base branch from 9dd9c4a to 3223bf9 Compare August 5, 2025 08:46
@ibetitsmike
ibetitsmike requested a review from spikecurtis August 5, 2025 09:36
@ibetitsmike
ibetitsmike force-pushed the mike/immortal-streams-backed-base branch 2 times, most recently from d2ee08d to 27da7ef Compare August 7, 2025 11:18
@ibetitsmike
ibetitsmike force-pushed the mike/immortal-streams-backed-base branch 3 times, most recently from 16abe05 to dde9516 Compare August 12, 2025 21:21

@spikecurtis spikecurtis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not done with my review, but taking a break and wanted to send you comments so far.

@spikecurtis spikecurtis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another batch of comments.

I haven't really looked at BackedPipe yet, but I think maybe it would be better to wait for the comments I've made so far to be resolved.

@ibetitsmike
ibetitsmike force-pushed the mike/immortal-streams-backed-base branch from 7468299 to b2188f9 Compare August 15, 2025 00:51
@ibetitsmike
ibetitsmike marked this pull request as ready for review August 15, 2025 08:50
@ibetitsmike
ibetitsmike force-pushed the mike/immortal-streams-backed-base branch from 45558ec to 064514e Compare August 19, 2025 06:52
@ibetitsmike
ibetitsmike force-pushed the mike/immortal-streams-backed-base branch from 95dc01a to 85c505d Compare August 20, 2025 12:38
@ibetitsmike
ibetitsmike force-pushed the mike/immortal-streams-backed-base branch from 28927dc to 9cafe05 Compare August 25, 2025 20:32
@github-actions github-actions Bot added the stale This issue is like stale bread. label Sep 6, 2025
@ibetitsmike
ibetitsmike force-pushed the mike/immortal-streams-backed-base branch 2 times, most recently from c65afb6 to 8b5040d Compare September 8, 2025 08:54
@ibetitsmike ibetitsmike removed the stale This issue is like stale bread. label Sep 8, 2025
@ibetitsmike
ibetitsmike force-pushed the mike/immortal-streams-backed-base branch from 9f720cc to 293804b Compare September 8, 2025 10:01
@ibetitsmike
ibetitsmike merged commit 4c98dec into main Sep 11, 2025
@ibetitsmike
ibetitsmike deleted the mike/immortal-streams-backed-base branch September 11, 2025 12:05
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Backed Pipe mechanism to handle unreliable connections

2 participants