I am trying to change the value of a variable from the server side. It
seems like when I print the value of the client's variable on the
server, the value is changing. However, the client doesn't get the
change. Creating new variables seems to sync fine, but overwriting
existing data doesn't seem to sync to the client.
Here is a link to my two pieces of a code: server.js and index.html
Actually I have noticed that, the very first server-side assignment to now.test does synchronize out to the client, but then after that, a second (3rd, ...) assignment does *not* sync. I have also worked around this with function calls etc.
On Sun, Apr 22, 2012 at 11:06 AM, Andy Luong <aluon...@gmail.com> wrote: > I am trying to change the value of a variable from the server side. It > seems like when I print the value of the client's variable on the > server, the value is changing. However, the client doesn't get the > change. Creating new variables seems to sync fine, but overwriting > existing data doesn't seem to sync to the client.
> Here is a link to my two pieces of a code: server.js and index.html
On Mon, Apr 23, 2012 at 1:50 PM, Nate Morse <morse.n...@gmail.com> wrote: > Actually I have noticed that, the very first server-side assignment to > now.test does synchronize out to the client, but then after that, a > second (3rd, ...) assignment does *not* sync. > I have also worked around this with function calls etc.
> On Sun, Apr 22, 2012 at 11:06 AM, Andy Luong <aluon...@gmail.com> wrote: >> I am trying to change the value of a variable from the server side. It >> seems like when I print the value of the client's variable on the >> server, the value is changing. However, the client doesn't get the >> change. Creating new variables seems to sync fine, but overwriting >> existing data doesn't seem to sync to the client.
>> Here is a link to my two pieces of a code: server.js and index.html
"Sync values using remote function calls rather than using synced
variables. As described above, some amount of traversal is required to
synchronize variables in the now namespace. If you need to rapidly set
a value on one client and then immediately use that value on the other
clients, consider broadcasting this using function calls. Function
calls are much faster than using variable syncing."
> Actually I have noticed that, the very first server-side assignment to
> now.test does synchronize out to the client, but then after that, a
> second (3rd, ...) assignment does *not* sync.
> I have also worked around this with function calls etc.
> On Sun, Apr 22, 2012 at 11:06 AM, Andy Luong <aluon...@gmail.com> wrote:
> > I am trying to change the value of a variable from the server side. It
> > seems like when I print the value of the client's variable on the
> > server, the value is changing. However, the client doesn't get the
> > change. Creating new variables seems to sync fine, but overwriting
> > existing data doesn't seem to sync to the client.
> > Here is a link to my two pieces of a code: server.js and index.html
> "Sync values using remote function calls rather than using synced
> variables. As described above, some amount of traversal is required to
> synchronize variables in the now namespace. If you need to rapidly set
> a value on one client and then immediately use that value on the other
> clients, consider broadcasting this using function calls. Function
> calls are much faster than using variable syncing."
> On Apr 23, 2:50 pm, Nate Morse <morse.n...@gmail.com> wrote:
> > Actually I have noticed that, the very first server-side assignment to
> > now.test does synchronize out to the client, but then after that, a
> > second (3rd, ...) assignment does *not* sync.
> > I have also worked around this with function calls etc.
> > On Sun, Apr 22, 2012 at 11:06 AM, Andy Luong <aluon...@gmail.com> wrote:
> > > I am trying to change the value of a variable from the server side. It
> > > seems like when I print the value of the client's variable on the
> > > server, the value is changing. However, the client doesn't get the
> > > change. Creating new variables seems to sync fine, but overwriting
> > > existing data doesn't seem to sync to the client.
> > > Here is a link to my two pieces of a code: server.js and index.html
I also agree that functions are more useful, and that the whole syncing of data with no events associated with updates is a bad idea. Syncing should be either augmented to include update notification events or the whole feature should be removed. Meanwhile there is definitely a bug.
On Mon, Apr 23, 2012 at 9:09 PM, Andy Luong <aluon...@gmail.com> wrote: > I agree that makes sense. However, I don't think the values are ever > getting overwritten. I tried waiting 5 seconds, and it seems to not be > synced.
> On Apr 23, 7:41 pm, Filipe Deschamps <fili...@gmail.com> wrote: >> "Sync values using remote function calls rather than using synced >> variables. As described above, some amount of traversal is required to >> synchronize variables in the now namespace. If you need to rapidly set >> a value on one client and then immediately use that value on the other >> clients, consider broadcasting this using function calls. Function >> calls are much faster than using variable syncing."
>> On Apr 23, 2:50 pm, Nate Morse <morse.n...@gmail.com> wrote:
>> > Actually I have noticed that, the very first server-side assignment to >> > now.test does synchronize out to the client, but then after that, a >> > second (3rd, ...) assignment does *not* sync. >> > I have also worked around this with function calls etc.
>> > On Sun, Apr 22, 2012 at 11:06 AM, Andy Luong <aluon...@gmail.com> wrote: >> > > I am trying to change the value of a variable from the server side. It >> > > seems like when I print the value of the client's variable on the >> > > server, the value is changing. However, the client doesn't get the >> > > change. Creating new variables seems to sync fine, but overwriting >> > > existing data doesn't seem to sync to the client.
>> > > Here is a link to my two pieces of a code: server.js and index.html