Skip to content

feat: add stream context to middleware and handlers#3547

Open
dozyio wants to merge 7 commits into
libp2p:mainfrom
dozyio:feat/stream-context
Open

feat: add stream context to middleware and handlers#3547
dozyio wants to merge 7 commits into
libp2p:mainfrom
dozyio:feat/stream-context

Conversation

@dozyio

@dozyio dozyio commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds per-stream context that can be shared between stream middleware and the final stream handler.

This allows middleware to attach typed values during stream setup and lets the handler read them without mutating the stream or connection objects.

Includes regression coverage for:

  • passing context from incoming middleware to the handler
  • creating a fresh context for each incoming stream

Notes & open questions

Requires #3534

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • I have added tests that prove my fix is effective or that my feature works

@dozyio dozyio marked this pull request as ready for review June 22, 2026 07:01
@dozyio dozyio requested a review from a team as a code owner June 22, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant