@dxos/client-services 0.1.54 → 0.1.55-main.0618d91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{chunk-F4BHRFH4.mjs → chunk-CSJSC47N.mjs} +50 -9
- package/dist/lib/browser/{chunk-F4BHRFH4.mjs.map → chunk-CSJSC47N.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +1 -1
- package/dist/lib/node/index.cjs +48 -7
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +48 -7
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/logging/logging-service.d.ts +3 -1
- package/dist/types/src/packlets/logging/logging-service.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/system/system-service.d.ts +3 -6
- package/dist/types/src/packlets/system/system-service.d.ts.map +1 -1
- package/package.json +32 -32
- package/src/packlets/logging/logging-service.ts +52 -2
- package/src/packlets/spaces/data-space.ts +6 -7
- package/src/packlets/system/system-service.test.ts +4 -4
- package/src/packlets/system/system-service.ts +9 -11
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Stream } from '@dxos/codec-protobuf';
|
|
2
|
-
import { LogEntry, LoggingService, QueryLogsRequest } from '@dxos/protocols/proto/dxos/client/services';
|
|
2
|
+
import { LogEntry, LoggingService, Metrics, QueryLogsRequest, ControlMetricsRequest, ControlMetricsResponse, QueryMetricsRequest } from '@dxos/protocols/proto/dxos/client/services';
|
|
3
3
|
/**
|
|
4
4
|
* Logging service used to spy on logs of the host.
|
|
5
5
|
*/
|
|
@@ -7,6 +7,8 @@ export declare class LoggingServiceImpl implements LoggingService {
|
|
|
7
7
|
private readonly _logs;
|
|
8
8
|
open(): Promise<void>;
|
|
9
9
|
close(): Promise<void>;
|
|
10
|
+
controlMetrics({ reset, record }: ControlMetricsRequest): Promise<ControlMetricsResponse>;
|
|
11
|
+
queryMetrics({ interval }: QueryMetricsRequest): Stream<Metrics>;
|
|
10
12
|
queryLogs(request: QueryLogsRequest): Stream<LogEntry>;
|
|
11
13
|
private _logProcessor;
|
|
12
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/logging/logging-service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,
|
|
1
|
+
{"version":3,"file":"logging-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/logging/logging-service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EACL,QAAQ,EACR,cAAc,EACd,OAAO,EACP,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,4CAA4C,CAAC;AAGpD;;GAEG;AACH,qBAAa,kBAAmB,YAAW,cAAc;IACvD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgC;IAEhD,IAAI;IAIJ,KAAK;IAKL,cAAc,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAc/F,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE,mBAAmB,GAAG,MAAM,CAAC,OAAO,CAAC;IA4BhE,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAAC,QAAQ,CAAC;IA4CtD,OAAO,CAAC,aAAa,CAEnB;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-space.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/data-space.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAA0C,M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AErB;IAED,IAAI,KAAK,2BAER;IAGK,IAAI;YAII,KAAK;IAWb,KAAK;YAIG,MAAM;IAed,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG;IAI/C,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI;;;IAIlE;;OAEG;IACH,2BAA2B;IAqBrB,sBAAsB;YAsDd,oBAAoB;IAiD5B,WAAW;IAyBX,QAAQ;IAWR,UAAU;CAWjB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Event } from '@dxos/async';
|
|
2
2
|
import { Stream } from '@dxos/codec-protobuf';
|
|
3
3
|
import { Config } from '@dxos/config';
|
|
4
|
-
import { SystemStatus,
|
|
4
|
+
import { SystemService, SystemStatus, UpdateStatusRequest, QueryStatusRequest, QueryStatusResponse } from '@dxos/protocols/proto/dxos/client/services';
|
|
5
5
|
import { MaybePromise } from '@dxos/util';
|
|
6
6
|
export type SystemServiceOptions = {
|
|
7
7
|
config?: Config;
|
|
@@ -10,9 +10,6 @@ export type SystemServiceOptions = {
|
|
|
10
10
|
onUpdateStatus: (status: SystemStatus) => MaybePromise<void>;
|
|
11
11
|
onReset: () => MaybePromise<void>;
|
|
12
12
|
};
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
13
|
export declare class SystemServiceImpl implements SystemService {
|
|
17
14
|
private readonly _config?;
|
|
18
15
|
private readonly _statusUpdate;
|
|
@@ -21,8 +18,8 @@ export declare class SystemServiceImpl implements SystemService {
|
|
|
21
18
|
private readonly _onReset;
|
|
22
19
|
constructor({ config, statusUpdate, onUpdateStatus, getCurrentStatus, onReset }: SystemServiceOptions);
|
|
23
20
|
getConfig(): Promise<import("@dxos/config").ConfigProto>;
|
|
24
|
-
updateStatus({ status }:
|
|
25
|
-
queryStatus(): Stream<
|
|
21
|
+
updateStatus({ status }: UpdateStatusRequest): Promise<void>;
|
|
22
|
+
queryStatus({ interval }?: QueryStatusRequest): Stream<QueryStatusResponse>;
|
|
26
23
|
reset(): Promise<void>;
|
|
27
24
|
}
|
|
28
25
|
//# sourceMappingURL=system-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/system/system-service.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EACL,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"system-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/system/system-service.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EACL,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1B,gBAAgB,EAAE,MAAM,YAAY,CAAC;IACrC,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;IAC7D,OAAO,EAAE,MAAM,YAAY,CAAC,IAAI,CAAC,CAAC;CACnC,CAAC;AAEF,qBAAa,iBAAkB,YAAW,aAAa;IACrD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAiC;IAC1D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAuC;IACrE,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA2C;IAC7E,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAyC;IACzE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkC;gBAE/C,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,OAAO,EAAE,EAAE,oBAAoB;IAQ/F,SAAS;IAIT,YAAY,CAAC,EAAE,MAAM,EAAE,EAAE,mBAAmB;IAKlD,WAAW,CAAC,EAAE,QAAgB,EAAE,GAAE,kBAAuB,GAAG,MAAM,CAAC,mBAAmB,CAAC;IAgBjF,KAAK;CAGZ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/client-services",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.55-main.0618d91",
|
|
4
4
|
"description": "DXOS client services implementation",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -22,40 +22,40 @@
|
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"tiny-invariant": "^1.3.1",
|
|
25
|
-
"@dxos/async": "0.1.
|
|
26
|
-
"@dxos/client-protocol": "0.1.
|
|
27
|
-
"@dxos/codec-protobuf": "0.1.
|
|
28
|
-
"@dxos/config": "0.1.
|
|
29
|
-
"@dxos/context": "0.1.
|
|
30
|
-
"@dxos/credentials": "0.1.
|
|
31
|
-
"@dxos/crypto": "0.1.
|
|
32
|
-
"@dxos/debug": "0.1.
|
|
33
|
-
"@dxos/document-model": "0.1.
|
|
34
|
-
"@dxos/echo-db": "0.1.
|
|
35
|
-
"@dxos/echo-pipeline": "0.1.
|
|
36
|
-
"@dxos/errors": "0.1.
|
|
37
|
-
"@dxos/feed-store": "0.1.
|
|
38
|
-
"@dxos/keyring": "0.1.
|
|
39
|
-
"@dxos/keys": "0.1.
|
|
40
|
-
"@dxos/lock-file": "0.1.
|
|
41
|
-
"@dxos/log": "0.1.
|
|
42
|
-
"@dxos/messaging": "0.1.
|
|
43
|
-
"@dxos/model-factory": "0.1.
|
|
44
|
-
"@dxos/network-manager": "0.1.
|
|
45
|
-
"@dxos/node-std": "0.1.
|
|
46
|
-
"@dxos/protocols": "0.1.
|
|
47
|
-
"@dxos/random-access-storage": "0.1.
|
|
48
|
-
"@dxos/rpc": "0.1.
|
|
49
|
-
"@dxos/teleport": "0.1.
|
|
50
|
-
"@dxos/teleport-extension-gossip": "0.1.
|
|
51
|
-
"@dxos/teleport-extension-object-sync": "0.1.
|
|
52
|
-
"@dxos/text-model": "0.1.
|
|
53
|
-
"@dxos/timeframe": "0.1.
|
|
54
|
-
"@dxos/util": "0.1.
|
|
25
|
+
"@dxos/async": "0.1.55-main.0618d91",
|
|
26
|
+
"@dxos/client-protocol": "0.1.55-main.0618d91",
|
|
27
|
+
"@dxos/codec-protobuf": "0.1.55-main.0618d91",
|
|
28
|
+
"@dxos/config": "0.1.55-main.0618d91",
|
|
29
|
+
"@dxos/context": "0.1.55-main.0618d91",
|
|
30
|
+
"@dxos/credentials": "0.1.55-main.0618d91",
|
|
31
|
+
"@dxos/crypto": "0.1.55-main.0618d91",
|
|
32
|
+
"@dxos/debug": "0.1.55-main.0618d91",
|
|
33
|
+
"@dxos/document-model": "0.1.55-main.0618d91",
|
|
34
|
+
"@dxos/echo-db": "0.1.55-main.0618d91",
|
|
35
|
+
"@dxos/echo-pipeline": "0.1.55-main.0618d91",
|
|
36
|
+
"@dxos/errors": "0.1.55-main.0618d91",
|
|
37
|
+
"@dxos/feed-store": "0.1.55-main.0618d91",
|
|
38
|
+
"@dxos/keyring": "0.1.55-main.0618d91",
|
|
39
|
+
"@dxos/keys": "0.1.55-main.0618d91",
|
|
40
|
+
"@dxos/lock-file": "0.1.55-main.0618d91",
|
|
41
|
+
"@dxos/log": "0.1.55-main.0618d91",
|
|
42
|
+
"@dxos/messaging": "0.1.55-main.0618d91",
|
|
43
|
+
"@dxos/model-factory": "0.1.55-main.0618d91",
|
|
44
|
+
"@dxos/network-manager": "0.1.55-main.0618d91",
|
|
45
|
+
"@dxos/node-std": "0.1.55-main.0618d91",
|
|
46
|
+
"@dxos/protocols": "0.1.55-main.0618d91",
|
|
47
|
+
"@dxos/random-access-storage": "0.1.55-main.0618d91",
|
|
48
|
+
"@dxos/rpc": "0.1.55-main.0618d91",
|
|
49
|
+
"@dxos/teleport": "0.1.55-main.0618d91",
|
|
50
|
+
"@dxos/teleport-extension-gossip": "0.1.55-main.0618d91",
|
|
51
|
+
"@dxos/teleport-extension-object-sync": "0.1.55-main.0618d91",
|
|
52
|
+
"@dxos/text-model": "0.1.55-main.0618d91",
|
|
53
|
+
"@dxos/timeframe": "0.1.55-main.0618d91",
|
|
54
|
+
"@dxos/util": "0.1.55-main.0618d91"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/readable-stream": "^2.3.9",
|
|
58
|
-
"@dxos/signal": "0.1.
|
|
58
|
+
"@dxos/signal": "0.1.55-main.0618d91"
|
|
59
59
|
},
|
|
60
60
|
"publishConfig": {
|
|
61
61
|
"access": "public"
|
|
@@ -5,8 +5,16 @@
|
|
|
5
5
|
import { Event } from '@dxos/async';
|
|
6
6
|
import { Stream } from '@dxos/codec-protobuf';
|
|
7
7
|
import { LogLevel, LogProcessor, LogEntry as NaturalLogEntry, getContextFromEntry, log } from '@dxos/log';
|
|
8
|
-
import {
|
|
9
|
-
|
|
8
|
+
import {
|
|
9
|
+
LogEntry,
|
|
10
|
+
LoggingService,
|
|
11
|
+
Metrics,
|
|
12
|
+
QueryLogsRequest,
|
|
13
|
+
ControlMetricsRequest,
|
|
14
|
+
ControlMetricsResponse,
|
|
15
|
+
QueryMetricsRequest,
|
|
16
|
+
} from '@dxos/protocols/proto/dxos/client/services';
|
|
17
|
+
import { jsonify, numericalValues, tracer } from '@dxos/util';
|
|
10
18
|
|
|
11
19
|
/**
|
|
12
20
|
* Logging service used to spy on logs of the host.
|
|
@@ -23,6 +31,48 @@ export class LoggingServiceImpl implements LoggingService {
|
|
|
23
31
|
log.runtimeConfig.processors.splice(index, 1);
|
|
24
32
|
}
|
|
25
33
|
|
|
34
|
+
async controlMetrics({ reset, record }: ControlMetricsRequest): Promise<ControlMetricsResponse> {
|
|
35
|
+
if (reset) {
|
|
36
|
+
tracer.clear();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (record === true) {
|
|
40
|
+
tracer.start();
|
|
41
|
+
} else if (record === false) {
|
|
42
|
+
tracer.stop();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return { recording: tracer.recording };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
queryMetrics({ interval }: QueryMetricsRequest): Stream<Metrics> {
|
|
49
|
+
// TODO(burdon): Map all traces; how to bind to reducer/metrics shape (e.g., numericalValues)?
|
|
50
|
+
const createNumericalValues = (key: string) => {
|
|
51
|
+
const consume = tracer.get(key) ?? [];
|
|
52
|
+
return { key, stats: numericalValues(consume, 'duration') };
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return new Stream(({ next }) => {
|
|
56
|
+
const update = () => {
|
|
57
|
+
const metrics: Metrics = {
|
|
58
|
+
timestamp: new Date(),
|
|
59
|
+
values: [
|
|
60
|
+
createNumericalValues('dxos.echo.pipeline.control'),
|
|
61
|
+
createNumericalValues('dxos.echo.pipeline.data'),
|
|
62
|
+
],
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
next(metrics);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
update();
|
|
69
|
+
const i = setInterval(update, interval);
|
|
70
|
+
return () => {
|
|
71
|
+
clearInterval(i);
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
26
76
|
queryLogs(request: QueryLogsRequest): Stream<LogEntry> {
|
|
27
77
|
return new Stream<LogEntry>(({ ctx, next }) => {
|
|
28
78
|
const handler = (entry: NaturalLogEntry) => {
|
|
@@ -190,7 +190,7 @@ export class DataSpace {
|
|
|
190
190
|
await this.initializeDataPipeline();
|
|
191
191
|
} catch (err) {
|
|
192
192
|
if (err instanceof CancelledError) {
|
|
193
|
-
log('
|
|
193
|
+
log('data pipeline initialization cancelled', err);
|
|
194
194
|
return;
|
|
195
195
|
}
|
|
196
196
|
|
|
@@ -208,8 +208,8 @@ export class DataSpace {
|
|
|
208
208
|
if (this._state !== SpaceState.CONTROL_ONLY) {
|
|
209
209
|
throw new SystemError('Invalid operation');
|
|
210
210
|
}
|
|
211
|
-
this._state = SpaceState.INITIALIZING;
|
|
212
211
|
|
|
212
|
+
this._state = SpaceState.INITIALIZING;
|
|
213
213
|
await this._inner.controlPipeline.state.waitUntilReachedTargetTimeframe({
|
|
214
214
|
ctx: this._ctx,
|
|
215
215
|
breakOnStall: false,
|
|
@@ -218,7 +218,7 @@ export class DataSpace {
|
|
|
218
218
|
this.metrics.controlPipelineReady = new Date();
|
|
219
219
|
|
|
220
220
|
await this._createWritableFeeds();
|
|
221
|
-
log('
|
|
221
|
+
log('writable feeds created');
|
|
222
222
|
this.stateUpdate.emit();
|
|
223
223
|
|
|
224
224
|
if (!this.notarizationPlugin.hasWriter) {
|
|
@@ -323,7 +323,6 @@ export class DataSpace {
|
|
|
323
323
|
});
|
|
324
324
|
|
|
325
325
|
await this.inner.controlPipeline.state.waitUntilTimeframe(new Timeframe([[receipt.feedKey, receipt.seq]]));
|
|
326
|
-
|
|
327
326
|
for (const feed of this.inner.dataPipeline.pipelineState?.feeds ?? []) {
|
|
328
327
|
const indexBeforeEpoch = epoch.timeframe.get(feed.key);
|
|
329
328
|
if (indexBeforeEpoch) {
|
|
@@ -335,7 +334,7 @@ export class DataSpace {
|
|
|
335
334
|
@synchronized
|
|
336
335
|
async activate() {
|
|
337
336
|
if (this._state !== SpaceState.INACTIVE) {
|
|
338
|
-
|
|
337
|
+
return;
|
|
339
338
|
}
|
|
340
339
|
|
|
341
340
|
await this._metadataStore.setSpaceState(this.key, SpaceState.ACTIVE);
|
|
@@ -346,10 +345,10 @@ export class DataSpace {
|
|
|
346
345
|
@synchronized
|
|
347
346
|
async deactivate() {
|
|
348
347
|
if (this._state === SpaceState.INACTIVE) {
|
|
349
|
-
|
|
348
|
+
return;
|
|
350
349
|
}
|
|
351
350
|
|
|
352
|
-
//
|
|
351
|
+
// Unregister from data service.
|
|
353
352
|
await this._metadataStore.setSpaceState(this.key, SpaceState.INACTIVE);
|
|
354
353
|
await this._close();
|
|
355
354
|
this._state = SpaceState.INACTIVE;
|
|
@@ -6,7 +6,7 @@ import { expect } from 'chai';
|
|
|
6
6
|
|
|
7
7
|
import { Event, Trigger } from '@dxos/async';
|
|
8
8
|
import { Config } from '@dxos/config';
|
|
9
|
-
import {
|
|
9
|
+
import { SystemService, SystemStatus, QueryStatusResponse } from '@dxos/protocols/proto/dxos/client/services';
|
|
10
10
|
import { beforeEach, describe, test } from '@dxos/test';
|
|
11
11
|
|
|
12
12
|
import { SystemServiceImpl } from './system-service';
|
|
@@ -55,8 +55,8 @@ describe('SystemService', () => {
|
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
test('queryStatus returns initial status', async () => {
|
|
58
|
-
const status = new Trigger<
|
|
59
|
-
systemService.queryStatus().subscribe((response) => {
|
|
58
|
+
const status = new Trigger<QueryStatusResponse>();
|
|
59
|
+
systemService.queryStatus({}).subscribe((response) => {
|
|
60
60
|
status.wake(response);
|
|
61
61
|
});
|
|
62
62
|
expect(await status.wait()).to.deep.equal({ status: SystemStatus.ACTIVE });
|
|
@@ -64,7 +64,7 @@ describe('SystemService', () => {
|
|
|
64
64
|
|
|
65
65
|
test('queryStatus streams status changes', async () => {
|
|
66
66
|
const statuses: SystemStatus[] = [];
|
|
67
|
-
systemService.queryStatus().subscribe(({ status }) => {
|
|
67
|
+
systemService.queryStatus({}).subscribe(({ status }) => {
|
|
68
68
|
statuses.push(status);
|
|
69
69
|
});
|
|
70
70
|
changeStatus(SystemStatus.INACTIVE);
|
|
@@ -6,10 +6,11 @@ import { Event } from '@dxos/async';
|
|
|
6
6
|
import { Stream } from '@dxos/codec-protobuf';
|
|
7
7
|
import { Config } from '@dxos/config';
|
|
8
8
|
import {
|
|
9
|
-
SystemStatus,
|
|
10
|
-
SystemStatusResponse,
|
|
11
9
|
SystemService,
|
|
12
|
-
|
|
10
|
+
SystemStatus,
|
|
11
|
+
UpdateStatusRequest,
|
|
12
|
+
QueryStatusRequest,
|
|
13
|
+
QueryStatusResponse,
|
|
13
14
|
} from '@dxos/protocols/proto/dxos/client/services';
|
|
14
15
|
import { MaybePromise } from '@dxos/util';
|
|
15
16
|
|
|
@@ -21,9 +22,6 @@ export type SystemServiceOptions = {
|
|
|
21
22
|
onReset: () => MaybePromise<void>;
|
|
22
23
|
};
|
|
23
24
|
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
25
|
export class SystemServiceImpl implements SystemService {
|
|
28
26
|
private readonly _config?: SystemServiceOptions['config'];
|
|
29
27
|
private readonly _statusUpdate: SystemServiceOptions['statusUpdate'];
|
|
@@ -43,11 +41,12 @@ export class SystemServiceImpl implements SystemService {
|
|
|
43
41
|
return this._config?.values ?? {};
|
|
44
42
|
}
|
|
45
43
|
|
|
46
|
-
async updateStatus({ status }:
|
|
44
|
+
async updateStatus({ status }: UpdateStatusRequest) {
|
|
47
45
|
await this._onUpdateStatus(status);
|
|
48
46
|
}
|
|
49
47
|
|
|
50
|
-
|
|
48
|
+
// TODO(burdon): Standardize interval option in stream request?
|
|
49
|
+
queryStatus({ interval = 3_000 }: QueryStatusRequest = {}): Stream<QueryStatusResponse> {
|
|
51
50
|
return new Stream(({ next }) => {
|
|
52
51
|
const update = () => {
|
|
53
52
|
next({ status: this._getCurrentStatus() });
|
|
@@ -55,10 +54,9 @@ export class SystemServiceImpl implements SystemService {
|
|
|
55
54
|
|
|
56
55
|
update();
|
|
57
56
|
const unsubscribe = this._statusUpdate.on(() => update());
|
|
58
|
-
const
|
|
59
|
-
|
|
57
|
+
const i = setInterval(update, interval);
|
|
60
58
|
return () => {
|
|
61
|
-
clearInterval(
|
|
59
|
+
clearInterval(i);
|
|
62
60
|
unsubscribe();
|
|
63
61
|
};
|
|
64
62
|
});
|