OpenAjax Event Publish and Subscribe Overview |
DEVELOPER |
The OpenAjax Alliance describes the OpenAjax Hub as the following:
"The OpenAjax Hub is a set of standard JavaScript functionality defined by the OpenAjax Alliance that addresses key interoperability issues that arise when multiple Ajax libraries are used within the same web page.
Version 1.0 of the OpenAjax Hub includes the following two key features for Ajax interoperability:
Ajax library loading and unloading control - The Hub provides APIs for registering libraries, unregistering libraries, and querying about previously registered libraries.
Publish/Subscribe Event Hub - The Hub provides an event hub using a publish/subscribe approach allows libraries to publish and subscribe to events in a reliable manner in order to coordinate actions across components from different Ajax libraries."
Copyright 2007-2008 OpenAjax Alliance
'OpenAjax Hub 1.0 Specification' OpenAjax Alliance Wiki, 14 December 2009. Web. 29 February 2012.
PROIV now supports publishing and subscribing to the OpenAjax Hub.
PROIV can publish to the OpenAjax Hub using the OpenAjaxPublishAsync and OpenAjaxPublishSync Client methods in the Open Client browser.
OpenAjaxPublishSync method publishes messages to the OpenAjax Hub in the Open Client browser. Subscribers to the message as defined in the $topic parameter receive the message payload as contained in the $data parameter. The kernel waits for a response from the method before continuing.
OpenAjaxPublishAsync method works in the same way as the OpenAjaxPublishSync but the kernel does not wait for a response before continuing.
PROIV can also subscribe to OpenAjax events whereby PROIV Functions can receive events published by the OpenAjax Hub, accept data from the event and run logic to process the data. This functionality is supported via Screen functions and only when connected using the Open Client.
When an OpenAjax Event Subscription (OAES) is stored against a Function Header, the function is in effect subscribing to that event. This means that when the OpenAjax Hub publishes an event and the function is running, the Open Client sends it to the function and the following steps occur:
The data mapped is loaded into the PROIV Variables.
The associated action (Local Logic, Global Logic or Function Key) is called. The data assigned from the OAES is made available and if the data sent is too long for the defined lengths, it is truncated silently.
Click here for more information about the OAES run-time behaviour for unsubscribe and re-subscribe events, changing cycles, event queuing and error handling.
Adding an OAES to a Function Header explains how to set up an OAES against a Function Header and set the properties for the subscription.
OpenAjax Event Subscription Actions Overview provides an overview of the actions that are called when a function subscribes to an OpenAjax event.
Creating OAES Data Mappings explains how to set up data mappings for an OAES.
Topic ID: 500609