"Presence"-based Model Data

43 views
Skip to first unread message

Jacob Godserv

unread,
Aug 18, 2012, 2:03:17 PM8/18/12
to der...@googlegroups.com
Is there a way to automatically delete data from a model once one or
more specific clients have disconnected? Because Derbyjs likes to
overwrite-on-edit, it would be nice to give users a way of knowing
when another user is editing a certain dataset. This edit status would
need to expire once the editor's browser closes, of course.

There are more uses for presence-based model data, but this is what
I've stumbled across right now. If no such thing exists, should I look
into patching Racer's model.on system?

--
Jacob

"For then there will be great distress, unequaled
from the beginning of the world until now — and never
to be equaled again. If those days had not been cut
short, no one would survive, but for the sake of the
elect those days will be shortened."

Are you ready?

greelgorke

unread,
Aug 20, 2012, 3:13:45 AM8/20/12
to der...@googlegroups.com
i dont know about auto-delete. but you may use 

socket.on('disconnect', function () {
    io.sockets.emit('user disconnected');
  });

from socket.io to catch teh disconnect and adjust you model in the callback
Reply all
Reply to author
Forward
0 new messages