ObservableCollections 使用 Rx 和 APE/反向 Ajax - 从服务器推送

发布于 2024-12-19 16:57:16 字数 412 浏览 1 评论 0原文

只是想知道是否有一种常用的方法来通知订阅者(javascript 客户端)可观察集合(Rx/Knockout.js)服务器端的更改。

我想要一个在集合之间进行双向实时数据绑定的对象。 IE。浏览器上的表绑定到一个集合,该集合绑定到服务器上的另一个集合,该集合绑定到数据库表或缓存数据集(全部实现 inotify...)。

从理论上讲,这听起来是可能的,但似乎找不到任何通用的方法来做到这一点。

我不想使用重新发送整个数据集的系统 - 我想利用基于事件的更新 Rx 或类似的东西(也许像通过 websockets 的 ConnectableObservable ?)。

如果没有,也许需要编码?

提前致谢。 安德鲁

(clinq、reactiveobject、websocket)

Just wondering if there was a commonly used method to notify subscribers (javascript clients) of observable collections (Rx/Knockout.js) of changes on the server side.

I'd like to have an object which does two-way live data-binding between collections. Ie. the table on the browser is bound to a collection which is bound to another collection on the server which is bound to a database table or cached data-set (all implementing inotify...).

Theoretically it sounds possible, but can't seem to find any common way of doing this.

I wouldn't want to use a system where entire data-sets were being re-sent - I'd like to utilise the event based updates Rx or something similar provides (maybe like ConnectableObservable over websockets?).

If not, maybe will have to code it up?

Thanks in advance.
Andrew

(clinq, reactiveobject, websocket)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

听风吹 2024-12-26 16:57:16

我不知道你的问题的完整解决方案。我认为这没有意义,因为它很大程度上取决于应用程序架构。

然而,部分解决方案已经存在。你提到了 Rx、KnockoutJS。 SQL Server 还提供有关数据修改的通知。

基于事件的客户端-服务器接口可以构建在 SignalR 之上。它是一个 JS+ASP.NET 工具包,可以在客户端和服务器之间创建持久连接,并允许双向发送事件。设置完成后,在其集线器上方编写一些同步代码应该相当容易。我想使用 RxJS 可以很容易地完成。缺点是该项目尚未处于生产状态,尽管有几个相当大的应用程序使用它。该项目看起来非常有前途。

因此,您可以尝试将这些软件片段根据需要粘合在一起。

希望这有帮助。

I'm unaware of a complete solution for your question. And I don't think it makes sense, because it strongly depends on the application architecture.

However, parts of the solution already exist. You've mentioned Rx, KnockoutJS. SQL Server also provides notifications on data modifications.

Client-server event-based interfaces can be built on top of SignalR. It's a JS+ASP.NET tools package that creates persistent connections between client and server and allows for sending events in both directions. Once you set it up, it should be rather easy to write some synchronization code above their hubs. I suppose it may be done using RxJS quite easily. The downside is that the project is not in production state yet, although there are several rather large applications that use it. And the project looks very promising.

So, you could try to take these pieces of software and glue them together as you need.

Hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文