lets have a "complex" site, there are three modules: "links", "home", "chat". Links, home just a static-like page, no need long polling, it doesnt even start. But in case "chat" any time a new message may arrive from other users, and I want to immediatly show it, without refreshing the site.
So, in "chat" a long-polling was started, and it detects that a new chat message arrived, so poll-requests finishes and sends a "send the chatbox-div" message - so that site may refresh the DIV.
But lets imagine three users are watching this module right now. How to notice all of them to refresh the content?
EDIT: how I imagine: lets somewhere save a flag which indicates that the message arrived, and the long polling request is watching this flag. If it changes, get the message, and zero that flag - but then its possible some users (some requests) wont notice that