| Great question! I'm really pumped about more folks getting involved. First off, you can manage pubsub as you like using Socket.io. The most important thing to realize about Sails is that we're not trying to be Meteor. This is for real, production projects, with a straightforward fallback to trusted technologies. How you manage publish and subscribe is completely up to you-- but if you're using the API blueprint, here's how it works from a pubsub perspective: GET /user => the socket who issued this request is subscribed to the class room, and the instance rooms for all models returned (until the socket closes) POST /user => the model created is "introduced" to the class room, subscribing all sockets connected to the class room, to IT. Then, all of the class room subscribers are notified that the new model has been created. PUT /user/n => sockets subscribed to the instance room for the model being updated receive a message DELETE /user/n => sockets subscribed to the instance room for the model being deleted receive a message and become unsubscribed The "magic" here is actually just a controller- you can take a peek here (https://github.com/balderdashy/sails/blob/master/lib/scaffol...) for more about what's going on in the blueprint. |