How to hold a response? And are there something called "maxHeldResponseCount"?

未关闭
#4,889 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
20/100
Issue 类型
文档
描述清晰度
需要澄清
活跃度
停滞
领域
api, backend

调研方向

该 issue 提到了 app.post("xxx"...) 以及一个保存响应的 map;首先在一个最小化的 Express 应用中复现该请求流程,并检查 Express 和 Node.js 中与请求处理相关的文档。完成的标准是记录该模式是否受支持,以及 Express 是否公开了所能保存的响应数量上限。

由索引模型根据 Issue 内容生成。

描述

awaiting more info
  1. I want to implement a long-polling model in my server (express.app).
  2. I use a map to stored incoming response, waiting (about 60 seconds later) another request to finally send stored response back.
  3. I find the store action will block other incoming request. I mean, the callback of app.post("xxx"...) is not called until I close some of stored responses in step 2.

So, I wonder:

  1. Is it a right method for me to store response from app.post to implement long-polling?
  2. Does express.js itself set max concurrent count of held responses?
主要语言
JavaScript
星标
69.7k
派生
25.6k
平均合并
2 天 9 小时
30 天内合并 PR
4

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

expressjs/express 的其他 Issue

查看 expressjs/express 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。