Skip to content
New issue

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

regarding now variables "auto-synced" #4

Closed
blaenk opened this issue Mar 12, 2011 · 2 comments
Closed

regarding now variables "auto-synced" #4

blaenk opened this issue Mar 12, 2011 · 2 comments

Comments

@blaenk
Copy link

blaenk commented Mar 12, 2011

Hey, this is probably a stupid question, but it seems like this would work wonderfully for what I am trying to do. My only question is, if I store a json object in now, and I only update some of the values in it, is there some mechanism in place to only "send" (if that's even what happens) the changed values, or does it send everything again?

To provide context: I am writing a web interface for a command-line program, communicating through xml-rpc. I would like to have it auto-update data on the pages, and so the closest I could get to this due to the nature of the program is polling. I don't want to do this on the client-side as this would bombard the program (if each client polls at different times). I was thinking of writing a node back-end that would itself poll the command line program on an interval, and then if there were changes to the data, it would push them out.

The 'auto-syncing' feature of the now namespace seemed really interesting for this application.

Basically the command-line app has a list of items each with its own properties, so the retrieved data by the node back-end would look roughly like this:

data = {
    item-1: {
        name: "first",
        progress: "53%"
    },
    item-2: {
        name: "second",
        progress: "67%"
    }
}

Something that might change from one poll interval to the next is item-2's progress, for example.

To repeat my question: If I were to simply re-assign the now.data variable each time with the new hash, is there a mechanism in place so that the client only has to download the changed part (item-2's progress)?

If not, can anyone provide any opinions/suggestions for what I'm trying to do?

I would really appreciate it.

@ericz
Copy link
Contributor

ericz commented Mar 25, 2011

Hi blaenk,

We just realized that the version of NowJS on github does not currently support changing in place. We had implemented the feature in an earlier version.

I am very sorry for the mix up. We are looking into re-integrating the feature and including it in the next release.

Sorry,
Eric

@blaenk
Copy link
Author

blaenk commented Mar 26, 2011

Hey ericz,

It's fine, thanks for giving me a heads up. I hadn't begun doing what I mentioned above yet, I was about to today but thanks for letting me know. I'll wait for the new release with this functionality in it. I would appreciate some notification when that release is available, perhaps here.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants