[Telemetry] Begin adding telemetry handler

Begin adding a general purpose handler for telemetry which
extends on the behavior associated with the telemetrySubscriber
by supporting access to historical data as well. WTD-806.
This commit is contained in:
Victor Woeltjen
2015-04-16 16:27:25 -07:00
parent 774c4dec1d
commit 60e888e16e
4 changed files with 128 additions and 36 deletions

View File

@ -0,0 +1,33 @@
/*global define*/
define(
['./TelemetryHandle'],
function (TelemetryHandle) {
"use strict";
/**
* A TelemetryRequester provides an easy interface to request
* telemetry associated with a set of domain objects.
*
* @constructor
* @param $q Angular's $q
*/
function TelemetryHandler($q, telemetrySubscriber) {
return {
handle: function (domainObject, callback, lossless) {
var subscription = telemetrySubscriber.subscribe(
domainObject,
callback,
lossless
);
return new TelemetryHandle($q, subscription);
}
};
}
return TelemetryHandler;
}
);