[Telemetry] Implement subscription pools

Implement data structures which support lossless/lossy
behaviors for telemetry subscriptions (that is, allow
users of the telemetrySubscriber to decide whether or not
they are willing to drop updates in favor of only being
notified with the latest available values.) WTD-784.
This commit is contained in:
Victor Woeltjen
2015-01-30 15:34:18 -08:00
parent acf4261a08
commit 590f4caa97
3 changed files with 131 additions and 2 deletions

View File

@ -32,18 +32,23 @@ define(
* associated telemetry data is of interest
* @param {Function} callback a function to invoke
* when new data has become available.
* @param {boolean} lossless flag to indicate whether the
* callback should be notified for all values
* (otherwise, multiple values in quick succession
* will call back with only the latest value.)
* @returns {TelemetrySubscription} the subscription,
* which will provide access to latest values.
*
* @method
* @memberof TelemetrySubscriber
*/
subscribe: function (domainObject, callback) {
subscribe: function (domainObject, callback, lossless) {
return new TelemetrySubscription(
$q,
$timeout,
domainObject,
callback
callback,
lossless
);
}
};