Real Time Web Applications
The real-time web is a network web using technologies and practices that enable users to receive information as soon as it is published by its authors, rather than requiring that they or their software check a source periodically for updates.
In our view, a Real Time Web Application has to be able to update the user's browser (the client) at any time and seamlessly, as if the browser was a monitor directly connected to the server where the application is running, and at the same time receive events and updates from the client without any delay.
Web based video games are perfect examples of Real Time Web. We have extended the concept to Line of Business Applications.
When the server supports WebSocket connections, the real time updates from Wisej are "pushed" to the client at any time. A background task can update the connected client asynchronously by calling Application.Update().
Some server or some browsers may not support WebSocket connections and can only use HTTP requests. In that case the server cannot possibly contact the browser because each HTTP request is started and terminated every time the browser contacts the server. One solution is to create a Wisej.Web.Timer to periodically fire server events and allow Wisej to update the client.
SignalR emulates a WebSocket connection by using the "long polling" technique, which is to always keep a pending request open to let the server send back an "unattended" response and then open a new suspended request. However, every request blocks a thread, it's prone to timeout errors, and browsers limit the number of open AJAX requests to 4-8 risking to block a request.
If a WebSocket connection is not possible, you can use automatic polling with Wisej. You can call Application.StartPolling() and Application.EndPolling() when you want Wisej to periodically send poll requests to the server. Both methods are ignored when the client is using a WebSocket connection. You can also setup the polling __ Interval in the configuration file to let clients always start the polling when WebSocket is not available.
Wisej sends all the updates that have occurred since the last request back to the client every time it processes a request. If you have a background task without a WebSocket connection, the browser will get updated everytime there is an event: a timer event, a click,...