fusic-meteor
fusic-meteor copied to clipboard
Users playing a song isn't representative
It never deletes user's of the list. We should make use of some sort of polling to make sure user is actually still playing the list or logged in, otherwise remove the user.
Something like https://github.com/murilopolese/howmanypeoplearelooking could be a good starting point
Just log a time stamp . No polling On Jun 29, 2014 5:13 PM, "Pepijn" [email protected] wrote:
It never deletes user's of the list. We should make use of some sort of polling to make sure user is actually still playing the list or logged in, otherwise remove the user.
Something like https://github.com/murilopolese/howmanypeoplearelooking could be a good starting point
— Reply to this email directly or view it on GitHub https://github.com/Rayman/fusic-meteor/issues/48.
Sorry, I didn't mean polling; the "howmanypeoplearelooking" solution is about monitoring the "socket close" event from somewhere deep inside the core of Meteor and then mapping it to one of the userIds. I think that's pretty clever, when you're disconnected obviously you can't be playing any songs.
So this part:
socket.on('close', Meteor.bindEnvironment(function () {
People.remove({
connectionID: socket.id
});
is where they basically remove a user from a collection based on the socket.id.