Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Free Nodelet Hack: AJAX-enabled Chatterbox

by tye (Sage)
on Mar 13, 2009 at 23:56 UTC ( #750547=note: print w/replies, xml ) Need Help??

in reply to Free Nodelet Hack: AJAX-enabled Chatterbox

Please include some "presence" detection such that leaving something like this "up" forever with no interaction times out and stops refreshing.

Update: Thanks!

- tye        

  • Comment on Re: Free Nodelet Hack: AJAX-enabled Chatterbox

Replies are listed 'Best First'.
Re^2: Free Nodelet Hack: AJAX-enabled Chatterbox
by bellaire (Hermit) on Mar 14, 2009 at 01:06 UTC
    Okay, done. If the user doesn't click "Talk" for 10 minutes, the script stops updating.

      ++ Really neat. You could instead of tying to it 10 minutes after talk tie it to page interaction. Put a listener on the body or something(?) and only refresh every x while there is page activity. Click or scroll, something. Might be the lightest server-load way to go.

        Yeah, I wanted to do something like that but I was having trouble figuring out what the best approach would be for "quiet" interaction detection. Since it occurred to me that people might actually start applying the thing in their free nodelets right away, I just implemented the first solution that came to mind so that tye's concerns would be addressed sooner rather than later. I'm not sure if binding a page-wide event would work that well? I haven't done that before, so if someone with experience here wants to give me a hint, it'd be appreciated.

        As to server load, I don't think the "talk" solution adds any appreciable load. If you aren't talking anyway, the server has to load the contents of the CB every 10 seconds for those 10 minutes, or about 60 times. Clicking "talk" triggers one extra round trip. That extra trip vs. the 60 that are already happening is hopefully not a big deal.

        Of course, the difference is that the CB update loads the chatterbox sidebar upper node, which (hopefully? maybe?) takes less server effort because it only renders the CB contents and any direct messages for the user. On the other hand, as far as I can tell, submitting a talk request might be doing more work, even if it's empty. Someone with more knowledge of the CB might be able to give me better information on what nodes to request/submit to make this nicer to the server in general.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://750547]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2022-05-26 18:00 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (93 votes). Check out past polls.