« first day (9 days earlier)      last day (46 days later) » 

1:20 AM
Got a question about subscriptions:
Why would I call .subscribe() against a model, vs just call .on("change"), and reacting to that instead?
Don't they do the same thing?
I guess, to be more specific; why is subscribe being called on the server in this line from the pad example?: github.com/codeparty/racer/blob/master/examples/pad/…
 
1:37 AM
It seems the .subscribe() call on the server can really just be a fetch(), since it just needs to fetch the data initially before it can render it out.
 
 
3 hours later…
4:41 AM
subscribe is just a fetch + you get ongoing updates
model.on doesn't get any data; it is a way to register event listeners for data changed locally or remotely
model.on won't do anything unless you also subscribe
 
5:11 AM
@NateSmith nice to meet you here. There are always a lot of questions to you.
What about adding FAQ to derbyjs.com? Also there can be links to resources. And maybe some tutorials.
 
Thanks for the info Nate. So in the pad example I mentioned before, the subscribe() called on the model serverside allowed for the "change" event to be emitted from the model on the client?
 
yeah, once you call subscribe, you should get changes until you are unsubscribed
would love a new site written on derby that has better resource links, etc
but waiting until 0.6 probably to get that done
 
5:31 AM
Got it, so the representation of the model that gets serialized out to the client has some sort of state that tells it that it's subscribed; and then from then on some sort of polling occurs that keeps it synced?
 
Yes. Server also knows about this state of every model and pushes changes to them as they occur
I will make derbyjs.com prototype with 0.6 and bootstrap.
 
I see; so polling was the wrong term. The server resolves update conflicts from the clients using OT and pushes out the 'correct' representation of the updated data to the clients
Is that over websockets?
 
Yes. Actually not data is transfered, but OT operations
 
Ok, so it's not like hitting a rest endpoint and getting a JSON blob back. You just get back operations that are consumed by the client and the client is responsible for getting their local representation correct?
 
ShareJS uses github.com/josephg/node-browserchannel for this. Because web-sockets can not guarantee order of messages, which is critical for OT
Yes. OT operations merging is happen on server and client
 
5:41 AM
Wow, this is really amazing stuff
 
Yeahh. :-)
 
Thanks for walking me through this; i'll be here often i'm sure as I try to build a POC out
 
You are welcome.
 
 
10 hours later…
ile
3:43 PM
@VladimirMakhaev Is that really true? the order of messages in websocket?
2
Q: Order of messages over a socket

Alex LopatinHi guys quick question: If i send two messages over the same html5 websocket a few hundred milliseconds apart from each other, is it theoretically possible for them to arrive in a different order than they were sent?

 
4:09 PM
It looks like order of messages is socket.io issue and not web sockets actually
I`ve just got it wrong
 
ile
4:30 PM
well i'm glad it's not a websocket issue
because websockets would be nice
i almost got worried
 
:-) everything will be good
 

« first day (9 days earlier)      last day (46 days later) »