MyBB Community Forums

Full Version: Live Thread: Great idea or suicide?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(2012-01-30, 11:07 PM)Scoutie44 Wrote: [ -> ]It's called a shoutbox, and yes it's pretty much server suicide if you have a lot of members on at once.

No it's not called a shoutbox. Thanks for your time though.
It's the same concept, except it's not in thread format. Other than that, they're the same thing, with the same effect.
I can remember this chat thing I found which only pings when there are new messages, if not it doesn't result in a query, had some weird concept, but I'll see if I can find it again, might be what you are looking for.
Still it's pretty obsolete and has no benefit, if you want live discussion just install a chat or IRC.
Judging by the replies in this thread, I'll assume that a lot of people are expecting this plugin to physically refresh the page if there are new posts. If this were the case, I would agree with the strain on the server, but it isn't. I'll structure this post based on the points given in this thread.

What if the user enters the thread and moves into another tab, forgetting about the live tab? This would cause replies to be loaded even for people not even focusing on the thread.
Using jQuery, you can add callbacks for when the window element is focus()'d or blur()'d, which are called when the user enters or leaves a tab, respectively. The javascript side of the plugin would simply log that the window element has blur()'d (I.E. moved to another tab) and register that change in a variable.

The timer that is used to check for new posts would simply reference that variable, and "if (tab_is_active) { retrieve the new posts } else { do nothing }". Simple.

After the user refocuses on the tab, the new replies would be loaded accordingly.

Granted it would only load a select number of new posts, in case the user moves away from a tab and returns to it an hours time later and is flooded with posts.

What if someone loads the page, but just isn't interested in viewing it? If they open the tab and move into some other program, for example.
The method mentioned above -- checking the window's focus state -- also works when the user changes programs or minimizes the browser.

Having a plugin query the database at regular intervals is just suicide for your server.
And how is this different from the person refreshing the page manually? I'll tell you how: requesting specific data will only query the database 2-3 times max. A regular refresh on a thread? As many queries as posts in that thread (10, on a full page), including some extra queries thrown in just for the hell of it.

This would be limited to certain threads, of course, and the user would be required to "enter live mode" in order to take part in this feature, limiting the possible load even further.

The plugin wouldn't need to display irrelevant data like reputation, so the data requested would be as minimal as possible.

I've seen first hand how many people just constantly appear in the "Who's online" list every 2 minutes reading the same thread for a live event, meaning all of those people are querying the database 20~ times each. Around 200~ queries every two minutes, just for 5 users. The live plugin would do a fifth of that, at only 10 queries every two minutes for those 5 users.

Obviously two minutes is an example, and the plugin would most likely reload the new posts at a quicker interval.

Feel free to question any of the arguments I've mentioned in this post; unless dealing with the blatantly ignorant, I'm open to dispute and accept any irregularities I may have posed.

b.
Can't we have something similar to facebook does? that will be huge load on server but just wanted to know if someone can make a similar thing
(2012-02-02, 01:59 AM)t_virus Wrote: [ -> ]Can't we have something similar to facebook does? that will be huge load on server but just wanted to know if someone can make a similar thing

Way to hijack a thread.
This would be a great idea for small boards designed for users 'chatting'.
Did this need bumping? How did you actually find this thread? It was buried...
Please don't gravedig old threads Shy
Pages: 1 2