[Telemetry] Add JSDoc

Add in-line documentation to scripts and methods that
were changed/introduced to support telemetry subscriptions,
which in turn were introduced to support autoflow
tabular views, WTD-614.
This commit is contained in:
Victor Woeltjen
2014-12-30 17:54:54 -08:00
parent b51d5762d8
commit cd6e2ff46d
3 changed files with 141 additions and 3 deletions

View File

@ -5,8 +5,39 @@ define(
function (TelemetrySubscription) {
"use strict";
/**
* The TelemetrySubscriber is a service which allows
* subscriptions to be made for new data associated with
* domain objects. It is exposed as a service named
* `telemetrySubscriber`.
*
* Subscriptions may also be made directly using the
* `telemetry` capability of a domain objcet; the subscriber
* uses this as well, but additionally handles delegation
* (e.g. for telemetry panels) as well as latest-value
* extraction.
*
* @constructor
* @param $q Angular's $q
* @param $timeout Angular's $timeout
*/
function TelemetrySubscriber($q, $timeout) {
return {
/**
* Subscribe to streaming telemetry updates
* associated with this domain object (either
* directly or via capability delegation.)
*
* @param {DomainObject} domainObject the object whose
* associated telemetry data is of interest
* @param {Function} callback a function to invoke
* when new data has become available.
* @returns {TelemetrySubscription} the subscription,
* which will provide access to latest values.
*
* @method
* @memberof TelemetrySubscriber
*/
subscribe: function (domainObject, callback) {
return new TelemetrySubscription(
$q,