Adopting `with`- style accessors as part of the Transport APIs
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- swift
- Lĩnh vực
- api, backend-api-design
Hướng nghiên cứu
Start by reading the existing Transport API entry points for connect(), send(), and receive(), then compare them with the proposed withClient closure flow. Done means a bootstrap can manage the connection for the closure, expose sending and incoming messages there, and close and clean up when the closure returns.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem? Please describe.
The current Transport APIs require the user to call connect() to establish a connection. From this point, the user has to manually track whether or not the connection is still alive, by handling any errors thrown by send or receive.
If a user wants to correctly handle error cases, this leads to more complexity in their implementations.
Describe the solution you'd like
In the Swift on Server ecosystem, we've adopted a with- style pattern, which compliments prior art in Swift's standard library. In there, we have a "bootstrap" for each transport that can be configured with the intended behavior of a transport connection.
let bootstrap = MCPTransportBootstrap()
A bootstrap connects in a with- style function call like so:
bootstrap.withClient { send, messages in
try await send(SomeToolCall())
for try await message in messages {
// Handle incoming traffic
}
}
Returning out of the withClient scope closes and cleans up the connection.
This pattern can be wrapped in more domain specific use cases like a request/response style flow in the higher level APIs.
- Ngôn ngữ chính
- Swift
- Star
- 1.6k
- Fork
- 270
- Merge trung bình
- 2 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 15
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelcontextprotocol/swift-sdk
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
modelcontextprotocol/swift-sdk#327 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Value decoding changes data-URL-looking JSON strings into Value.dataCó thể đã có người làm @bitbemol đã nhận 73 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
modelcontextprotocol/swift-sdk#277 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
modelcontextprotocol/swift-sdk#274 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
`HTTPClientTransport` fails to build on Windows: `#if !os(Linux)` guards no longer match the `EventSource` platform conditionCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
modelcontextprotocol/swift-sdk#261 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Client.withBatch leaves per-request tasks pending when transport.send throwsCó thể đã có người làm @bbdu3 đã nhận 1 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
modelcontextprotocol/swift-sdk#324 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của modelcontextprotocol/swift-sdk
Issue tương tự
-
[java] TestClassWithoutTestCases: document that abstract classes and interfaces are not checkedĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
VictorKildahl/cra#302 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
文件夹设置bugĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
joeseesun/qiaomu-jot#14 ·
Maintainer thường phản hồi trong vòng 1 ngày