@param data
/
_timerTickHandler
= function (timerTickEvent) {
var start, end, diff, discardThreshold, processed;
start = (new Date()).getTime();
processed = false;
//Prevent starvation of timer logic
if (_lastProcessedTimerTick === null) {
processed = _processTick(start);
} else {
if ((_lastProcessedTimerTick + _forceTickProcessingEvery) <= start) {
//Force processing at least every _forceTickProcessingEvery milliseconds
processed = _processTick(start);
}
end = (new Date()).getTime();
diff = end - start;
if (diff > _maxTimerCallbackThreshold) {
_clientLogs.log("GadgetXYZ took too long to process timer tick (_maxTimerCallbackThreshold
exceeded).");
}
},
If you choose not to use the boilerplate gadget tick code, you should ensure the following:
• Callback calculates entry and exit time.
• Callback for timer tick is quick (log when callback takes to long - only when exceeding threshold).
• Callback provides discard capability (as outlined in the boilerplate gadget tick code) to prevent events
from piling up.
• Callback adds a _lastProcessedTimerTick and uses it to force an update to occur at regular intervals (such
as every 10 seconds). The intent is to prevent starvation in a heavily-loaded system that cannot respond
quickly enough, such that all events are being discarded.
Because the timer callback triggers every 1 second and the JavaScript engine is single-threaded, it is important
to process as quickly as possible. Using the boilerplate code makes gadget development issues more obvious
and easier to debug.
Note
Handling Special Characters in CSS
When using CSS in a gadget, the Finesse Desktop Gadget Container restricts the following special characters:
@ ^ $ * :: ~
If the CSS contains any of the special characters listed above, copy the following JavaScript code into your
gadget’s .js file:
/
Injects css or js files into DOM dynamically.
This is to bypass gadget container's restriction for special chars in CSS 3 files.
E.g. @Keyframes
*/
Cisco Finesse Web Services Developer and JavaScript Guide, Release 12.5(1)
403
Finesse Desktop Gadget Development
Handling Special Characters in CSS