javascript - see and talk to your currently online users on your site in rails3 app -


i have rails3 app , want able see list of online. example user1, ip address, country. want able open chat / push messages user until leave site.

how can accurately monitor on site , instantly remove list when leave ?

i can talk them via faye pub/sub.

any 1 done ?

thanks rick

how can accurately monitor on site , instantly remove list when leave ?

well using http can not "instantly" in browser. solutions see use heartbeat technique. every x secounds, request sent browser (using ajax), tells if user online. if haven't heard user in x heartbeats, regard user disconnected - facebook uses this, seams. recommend drop requirement instant, unless it's important.

another approach implement flash or silverlight, make socket connection server. demand on server high, , if many people on site, run trouble ports , on.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -