As for web applications (and Rails applications), in real time it is just an illusion. A long survey is a very close approximation. Unfortunately, it is not very suitable for Rails. Especially since the Passenger.
A lengthy survey requires a constant open connection for each user that does not scale on servers that were not designed to handle it (for example, Apache). Unfortunately, in fact, there are many servers designed for long-term scalability that go well with Rails. You can try the Shooting-Star server, but I really don't know how its performance compares with Passenger for your standard queries.
My personal opinion on a lengthy survey is a solution that needs a problem.
Indeed, you should ask yourself the following questions:
- Are these updates with a high enough priority that they cannot wait 40 seconds?
- What happens if updates are not received immediately?
- Can my users focus on my application so much that waiting 15 seconds will negatively affect their experience?
- What percentage of user attention does my application attract under normal use?
- How long does it take to respond to an update?
- Do you really need to be in real time?
Some of these questions ask other questions differently, but this kind of thing is necessary with such subjective questions.
I think you see what I get: real-time updates are very nice, but never needed. If you are working on something that the consequence of the inability to respond to real-time updates is the end of the world. You really should not develop it as a web application at all.
If you still mean real-time updates, you can check out Juggernaut . But this is a Flash based solution.
source share