TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

HTTP Feeds: a minimal specification for polling events over HTTP

72 点作者 sea-gold14 天前

8 条评论

hombre_fatal14 天前
It could use a section on high level justification &#x2F; inspiration.<p>For example, what inspired this over a typical paginated API that lets you sort old to new with an afterId parameter?
philsnow14 天前
Because the client requests pagination by lastEventId (a UUID), the server needs to remember every event forever in order to correctly catch up clients.<p>If instead the client paginated by lastEventTimestamp, then a server that for any reason no longer had a particular event UUID could at least start at the following one.
评论 #43810237 未加载
sea-gold14 天前
Previously discussed (April 2022; 95 comments): <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=30904220">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=30904220</a>
zzo38computer13 天前
I think that HTTP is not the best way to do it, and that JSON is also not the best way to do it. (HTTP may work reasonably when you only want to download existing events and do not intend to continue polling.)<p>I also think using UUID alone isn&#x27;t the best way to make the ID number. If events only come from one source, then just using autoincrementing will work (like NNTP does for article numbers within a group); being able to request by time might also work (which is also something that NNTP does).
lud_lite14 天前
What happens if you need to catch up? You keep calling in a loop with a new lastEventId?<p>What is the intention there though. Is this for social media type feeds, or is this meant for synchronising data (at the extreme for DB replication for example!).<p>What if anything is expected of the producer in terms of how long to store events?
评论 #43809137 未加载
DidYaWipe14 天前
Never heard of &quot;CloudEvents&quot; before. How do people feel about those?
评论 #43810848 未加载
评论 #43809905 未加载
评论 #43809881 未加载
wackget14 天前
Did someone just reinvent a GET API with cursor-based pagination?
评论 #43816872 未加载
fefe2314 天前
This is an astonishingly bad idea. Don&#x27;t do this.<p>Use HTTP server-sent events instead. Those can keep the connection open so you don&#x27;t have to poll to get real-time updates and they will also let you resume from the last entry you saw previously.<p><a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;API&#x2F;Server-sent_events&#x2F;Using_server-sent_events" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;API&#x2F;Server-sent...</a>
评论 #43808496 未加载
评论 #43808534 未加载
评论 #43810897 未加载