2

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)

dioptre
  • 21
  • 2

1 Answers1

1

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.

Pavel Gatilov
  • 7,579
  • 1
  • 27
  • 42
  • 1
    Yep that sounds like what I was thinking. [http://www.amazedsaint.com/2011/11/introduction-ksigdo-knockout-signalr-to.html?m=1](http://www.amazedsaint.com/2011/11/introduction-ksigdo-knockout-signalr-to.html?m=1) has a good start point. I'll prob start there and work on developing binding for more complex objects. Nothing seems to be out of the box as far as I can tell. – dioptre Dec 08 '11 at 06:26