mirror of
https://github.com/nasa/openmct.git
synced 2025-02-06 11:09:21 +00:00
[Telemetry Collections] Add process method to historical request options (for yield requests) (#4201)
* added processor generator to request options in the telemetry API. Allows progressive yielding of request results. Co-authored-by: Andrew Henry <akhenry@gmail.com>
This commit is contained in:
parent
dad9f12a5c
commit
e56c673005
@ -115,6 +115,7 @@ export class TelemetryCollection extends EventEmitter {
|
|||||||
|
|
||||||
this._requestHistoricalTelemetry();
|
this._requestHistoricalTelemetry();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If a historical provider exists, then historical requests will be made
|
* If a historical provider exists, then historical requests will be made
|
||||||
* @private
|
* @private
|
||||||
@ -126,20 +127,25 @@ export class TelemetryCollection extends EventEmitter {
|
|||||||
|
|
||||||
let historicalData;
|
let historicalData;
|
||||||
|
|
||||||
|
this.options.onPartialResponse = this._processNewTelemetry.bind(this);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.requestAbort = new AbortController();
|
this.requestAbort = new AbortController();
|
||||||
this.options.signal = this.requestAbort.signal;
|
this.options.signal = this.requestAbort.signal;
|
||||||
historicalData = await this.historicalProvider.request(this.domainObject, this.options);
|
historicalData = await this.historicalProvider.request(this.domainObject, this.options);
|
||||||
this.requestAbort = undefined;
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error requesting telemetry data...');
|
if (error.name !== 'AbortError') {
|
||||||
this.requestAbort = undefined;
|
console.error('Error requesting telemetry data...');
|
||||||
this._error(error);
|
this._error(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.requestAbort = undefined;
|
||||||
|
|
||||||
this._processNewTelemetry(historicalData);
|
this._processNewTelemetry(historicalData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This uses the built in subscription function from Telemetry API
|
* This uses the built in subscription function from Telemetry API
|
||||||
* @private
|
* @private
|
||||||
|
Loading…
x
Reference in New Issue
Block a user