Tuesday, 11 March 2014

Rapide Global Listener

A recent enhancement for Rapide was a new Listener feature that introduced the ability to listen for events within the same session, i.e. one p-step listening for events from a separate p-step in the same browser window or mobile device.

Rapide has now been updated to incorporate the Rapide Global Listener (RGL), which allows Rapide clients to receive notifications  issued from any other p-step, either in the same application server, in a different application server (for example when using load balancing) or even from a completely different environment (for example a batch job or server procedure step).

The RGL is implemented as a standalone executable and uses TCP/IP sockets for communication between the RGL and the Rapide runtime.

In the first release, events are posted to the RGL from a Rapide client application. In subsequent releases APIs will be provided to enable notification events to be posted from non-Rapide clients, for example Gen batch jobs or server procedure steps.

A typical use of a listener is to replace the need for a client to poll a server to check for updates. Consider the example of the Rapide sample booking application which lists conference room bookings. If you want the list to automatically refresh to show the latest bookings without the user needing to press a Refresh button, a typical approach to this in a Windows GUI would be to use a timer control to post an event to the client p-step which then triggers a server call to refresh the list.  If the timer is set to perform an update every 5 seconds, then this results in  over 5000 calls to the server in a working day - per client! If the application has 1000 users, then you have 5 million server transactions just to keep the list updated.

If the same requirement is replaced by the Rapide listener, then the client only needs to refresh the list when it receives a notify event from the listener, which is triggered when a booking is made or changed. In our example, you might have 20 bookings per day, so the 1000 users refreshing the list 20 times is a reduction in server transactions from over 5 million to 20,000.

The Rapide controls demo and booking demo have been updated to illustrate the use of the Global listener.