Code Monkey home page Code Monkey logo

Comments (4)

muxiangqiu avatar muxiangqiu commented on June 6, 2024

@yetangye SSE 组件可以详细描述一下功能,对标那个框架的那个功能,你说的是 websocket 实现的那种功能吗?

from malagu.

yetangye avatar yetangye commented on June 6, 2024

谢谢你的回复。抱歉哈,我昨天错写成了Server Side Push,应该是Server Side Event。

我最近正在找一个后端的Koa框架下可用的SSE组件,目的是在需要时可方便的从后端向浏览器前端主动发送数据。找到了这个(https://github.com/yklykl530/koa-sse),但是看作者已经不怎么维护了。

我期望这个SSE组件具备如下功能哈。

  1. 可用注解的方式创建一个SSE,并指明SSE的网址。

  2. SSE信道的建立,重连都不需要使用者关心。有相应的连接完成,连接断开,重连中等事件告知使用者即可。

  3. 记录每个连接该信道的浏览器端连接对象,供后续从服务器端推送数据给相应的浏览器前端。

  4. 支持广播。

  5. 可以方便的集成到Koa框架下。

感谢!

from malagu.

muxiangqiu avatar muxiangqiu commented on June 6, 2024

感谢你的反馈。我明白你的意思了,Malagu 框架是应用开发框架,类似 nestjs、eggjs 等框架,底层可以基于 expressjs 或者 koajs 运行。

如果我采用 malagu 组件的方式实现 SSE,理论上是可以集成到 Koa,但是不推荐这么做,这相当于把高阶框架集成到了低阶框架,会带来不必要的依赖,比如有关 IoC 相关的依赖。

Malagu 是一个 Serverless 优先的框架,不知道你是否考虑部署到 Serverless,当然 Malagu 也支持运行在传统的服务器上。Serverless 目前对长连接支持不是很友好,服务端推的模式在 Serverless 场景下不可以用。所以,目前在 Malagu 上支持 SSE 优先级会比较低。不知道你这边可不可以先考虑客户端拉的模式。

Malagu 框架在设计上还是有不少创新,不知道你是否愿意深入了解一下 Malagu,以及 Serverless 的相关优势,然后再权衡一下是选择 Koa,还是 Malagu。

from malagu.

yetangye avatar yetangye commented on June 6, 2024

谢谢回复哈。
好的,我明白Malagu的定位了,这个功能我们也不是很着急,没关系哈。

from malagu.

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.