I am using private_pub 1.0.3 gem
which is build on top of faye
and able to use it in my localhost. Now I want to implement functionality to check if user online status is online or offline using this gem.
I am totally new to web sockets and found private_pub really easy to configure it so implemented it.....but Now I am stuck in the above mentioned problem. So, please let me know what is the proper solution for it.
I found this tutorial http://www.ryanepp.com/blog/how-do-i-tell-if-a-user-is-online and I think that can solve my problem....I have configured redis server and tested it through console, it is all working.....Now all I want to do is to replace websocket-rails
part of code with our own private_pub
gem utilization.
UPDATE
I found these faye
events:
bayeux.bind('disconnect', function(clientId) {
// event listener logic
});
client.bind('transport:down', function() {
// Fires when the connection is lost
});
client.bind('transport:up', function() {
// Fires when the connection is established
});
But, how can I use and bind these events using private_pub
gem
NEW-UPDATE
I have opened issue in github for faye-rails
and private_pub
gem, please visite them, I have done partial solution for problem, but that didn't fully solved my problem
Thanks