Universal Messaging 10.3 | Developer Guide | Enterprise APIs | Enterprise Developer's Guide for VBA | Publish / Subscribe | Learn More | Internal Event Processing
 
Internal Event Processing
Microsoft Excel is a single threaded application, therefore it cannot process events when it is in a busy state. Every time an event is received by the RTD server, a notification that new data is available is sent to Excel. As soon as Excel receives this notification it will request data from the RTD server. During this request, Excel enters a busy state and will therefore drop any further notifications that more data is available. If Excel responded to every notification it would be appropriate to simply allow excel to pop an event off the internal event queue and return this data (then deal with the next request) but as this is not the case, a different solution needs to be approached.
The Universal Messaging RTD server approaches this scenario in two different ways:
Processing Historical Data
If a user specifies an eid previous to that of the last published event (0 or less than -1) it is assumed that every event up to the last published event is required by Excel. In this case, the Universal Messaging RTD server will continue to notify Excel that new data is available until the internal event queue is empty and the last published event on the channel has been consumed. Every time Excel requests data it will pop one event off the internal event queue for that channel and update its cells. This ensures that every value is returned to Excel however quickly the events are received.
Once the last published event has been consumed, the RTD server returns to its normal state as described below.
Normal Processing State
Every time Excel requests data, the entire internal event queue is consumed internally and the most recent value required for each cell is returned to Excel.
Every event is processed internally, however only the most recent value that a cell requires is returned. For example if a cell is subscribed to a channel and requests events with property "name". If 50 events are queued internally, each event will be processed but only the most recent value of name would be returned to Excel. This saves Excel from making 50 separate requests for data when it may be that only one of the 50 events contains the property "name". If all 50 events contained the property "name" then returning the value 50 times would cause the value of the cell to rapidly change which is not generally required for an Excel application.