We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如果我没有看错的话,当选手提交后,为了达到实时更新的效果,目前uoj采取的方法是每500ms访问一次/submission/xxxxx?get=status-details(这里xxxxx表示提交的ID),直到"judged":true。
/submission/xxxxx?get=status-details
xxxxx
"judged":true
我觉得在比赛的时候,会有一大堆waiting,这时候请求是非常频繁的,不妨尝试codeforces的方法,使用nginx-push-stream-module。感觉上可以减轻服务器负担。
The text was updated successfully, but these errors were encountered:
如果能直接 stream (没有 buffer)的话可以直接用 server-sent events,收到更新发几行文本就好了
https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events
支持自动掉线重连、重连的时候(我记得是)Last-Event-Id 是最后一个收到的事件的 id
Last-Event-Id
兼容性可能是个问题,不过貌似不是关键功能不太要紧
Sorry, something went wrong.
赞同 server-sent events,或者 websocket(比如 GitHub 右上角的 notification)。
兼容性的话,sse ~ 83.45%,websocket ~ 90.98% 都得基本抛弃 IE 了(当然有些办法比如 link)。
其实感觉这里还好,实在不行可以先上redis对这一个api做下缓存。
神 预 言 等社区版里修吧(
No branches or pull requests
如果我没有看错的话,当选手提交后,为了达到实时更新的效果,目前uoj采取的方法是每500ms访问一次
/submission/xxxxx?get=status-details
(这里xxxxx
表示提交的ID),直到"judged":true
。我觉得在比赛的时候,会有一大堆waiting,这时候请求是非常频繁的,不妨尝试codeforces的方法,使用nginx-push-stream-module。感觉上可以减轻服务器负担。
The text was updated successfully, but these errors were encountered: