Event on client disconnect/abort in a streaming response
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- aws, node.js, typescript
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Bắt đầu tại điểm vào awslambda.streamifyResponse và kiểm tra vòng đời của responseStream, đặc biệt là nỗ lực thêm listener close được nêu trong issue. Xác định cách một client abort hoặc disconnect được biểu diễn, sau đó xác minh rằng một event được phát ra trong vòng lặp streaming và hành vi của nó được bao phủ bởi một test phù hợp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Im wondering if its possible to get any event emitted when a client aborts or disconnects during a streaming response with awslambda.streamifyResponse. I tried with this code, but from my testing it looks like theres no event emitted on the Lambda when that happens:
exports.handler = awslambda.streamifyResponse(
async (event, responseStream, context) => {
responseStream.setContentType('text/event-stream')
responseStream.on("close", ()=> {
// this never gets emitted at any point
console.log("responseStream closed");
});
for (let i = 0; i < 20; i++) {
await sleep(1000);
responseStream.write(`event: ping\n`);
responseStream.write(`data: ${i}\n\n`);
}
responseStream.end();
}
);
This would be an awesome feature to add in the age of SSR streaming, LLM's and more.
- Ngôn ngữ chính
- TypeScript
- Star
- 224
- Fork
- 60
- Merge trung bình
- 26 phút
- Pull request đã merge (30 ngày)
- 2
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 aws/aws-lambda-nodejs-runtime-interface-client
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
aws/aws-lambda-nodejs-runtime-interface-client#198 · 3 bình luận · 6 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
aws/aws-lambda-nodejs-runtime-interface-client#195 · 12 reaction ·
-
bug
aws/aws-lambda-nodejs-runtime-interface-client#170 · 15 bình luận · 6 reaction · 1 người được giao ·
-
AWS Inspector findings for curl Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 38/100
aws/aws-lambda-nodejs-runtime-interface-client#159 · 2 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
aws/aws-lambda-nodejs-runtime-interface-client#121 · 5 bình luận ·
Tất cả issue của aws/aws-lambda-nodejs-runtime-interface-client
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
copse-dev/agent-pane#2953 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Đang mởbug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Client support matrix inclusion Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
calcite-components needs triage refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Esri/calcite-design-system#15203 ·