Coder Social home page Coder Social logo

评测结果的更新(刷新)方式 about uoj HOT 4 OPEN

vfleaking avatar vfleaking commented on August 16, 2024
评测结果的更新(刷新)方式

from uoj.

Comments (4)

dramforever avatar dramforever commented on August 16, 2024 4

如果能直接 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

兼容性可能是个问题,不过貌似不是关键功能不太要紧

from uoj.

virusdefender avatar virusdefender commented on August 16, 2024 2

其实感觉这里还好,实在不行可以先上redis对这一个api做下缓存。

from uoj.

shuding avatar shuding commented on August 16, 2024

赞同 server-sent events,或者 websocket(比如 GitHub 右上角的 notification)。

兼容性的话,sse ~ 83.45%websocket ~ 90.98% 都得基本抛弃 IE 了(当然有些办法比如 link)。

from uoj.

abc1763613206 avatar abc1763613206 commented on August 16, 2024

神 预 言
等社区版里修吧(

from uoj.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.