Support substituting `receive()` with a different AsyncSequence
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
Research direction
Start by locating the Transport API and its receive() declaration, then inspect the conforming transport implementations and related tests. Determine all affected call sites and verify that a transport can provide an alternative AsyncSequence with backpressure while existing message handling and error behavior remain covered.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
The current Transport API mandates that the receive() function is an AsyncThrowingStream. Unfortunately, this type doesn't support backpressure. Meaning that if the messages are handled slower than they arrive, this will start (slowly or quickly) blowing up memory. At large volumes, this can cause an unintentional Denial of Service.
Describe the solution you'd like
If we can have an associatedtype instead of the AsyncThrowingStream, Swift(NIO) based libraries can provide their own implementations that support backpressure. That would eliminate this problem.
associatedtype Messages: AsyncStream<Data, any Error>
- Dominant language
- Swift
- Stars
- 1.6k
- Forks
- 278
- Avg merge
- 11h 15m
- Merged PRs (30d)
- 46
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from modelcontextprotocol/swift-sdk
-
-32042 without elicitations drops JSON-RPC error dataPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
modelcontextprotocol/swift-sdk#381 ·
Maintainers usually reply within 1 day
-
StdioTransport traps ("Negative value is not representable") when stdio is a socket, e.g. spawned by Node clientsPossibly taken @branben claimed this 9 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
modelcontextprotocol/swift-sdk#327 · 1 comment ·
Maintainers usually reply within 1 day
-
Value decoding changes data-URL-looking JSON strings into Value.dataPossibly taken @bitbemol claimed this 89 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
modelcontextprotocol/swift-sdk#277 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 78/100
modelcontextprotocol/swift-sdk#274 ·
Maintainers usually reply within 1 day
-
`HTTPClientTransport` fails to build on Windows: `#if !os(Linux)` guards no longer match the `EventSource` platform conditionMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
modelcontextprotocol/swift-sdk#261 ·
Maintainers usually reply within 1 day
All issues in modelcontextprotocol/swift-sdk
Similar issues
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
manaflow-ai/cmux#59692 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 2 days
-
App 仍在下载和解析用不上的会话列表Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
vibe-cafe/vibe-usage-app#125 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 76/100
touyou/CheckItOut#39 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
touyou/IntentTodo#232 ·
Maintainers usually reply within 1 day