On Oct 22, 2:48 am, Emerson Macedo <
emerle...@gmail.com> wrote:
> How about send an event when a client disconnects? It can be implemented
> using EventEmiters, what do you think?
This keeps coming up and honestly I don't think it's that useful. In
my apps I find that a single Faye client does not often correspond to
an actor in the application, for example a user may use several
clients across page views but should be considered one entity by the
application. The connect/disconnect messages sent by these clients
would not contain information that would let you tie them to the user,
making them not much use for figuring out whether the user is still
active.
I'm not sure I've explained that too well, but the short version is
that I usually need to figure out a ping+timeout setup that makes
sense in each application. You can use Faye channels to send these
pings, but the clients themselves should not get too coupled to your
domain logic.