← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 2313.e.5.f.10.c.1.c.2.b

长轮询等待数据到达

理解等级:中级

长轮询请求在服务端等待消息或超时,返回后客户端重新建立请求。它减少空查与轮询间隔延迟,同时需要正确设置连接、服务端等待及客户端超时,不能把等待连接视为无限资源。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • Event-driven Systems · 查看原书依据

      Long polling addresses the limitations of short polling by allowing consumers to wait for messages to become available. When a consumer sends a long polling request, the message queue holds the request open until a message arrives or a timeout occurs.

    参考来源

    - 位置:《Building Distributed Systems Designing scalable architectures with microservices, event-driven patterns, and robust deployment…》第06章《Event-driven Systems》(来源项目book-sources;源文件:extracted/Building Distributed Systems Designing scalable architectures with microservices, event-driven patterns, and robust deployment…/_epub-src/OPS/ch06.xhtml) - 结论依据:原文的机制或对比支持以下核心判断:长轮询请求在服务端等待消息或超时,返回后客户端重新建立请求。 本卡将相邻说明中的适用限制保留为解释。 - 原始内容:Long polling addresses the limitations of short polling by allowing consumers to wait for messages to become available. When a consumer sends a long polling request, the message queue holds the request open until a message arrives or a timeout occurs.