Skip to content

Commit d2a81b4

Browse files
committed
address PR comments
1 parent 81e9e93 commit d2a81b4

File tree

4 files changed

+12
-26
lines changed

4 files changed

+12
-26
lines changed

config.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,12 @@
184184
lmstEpoch: Date.UTC(2020, 2, 18, 0, 0, 0),
185185

186186
/*
187-
* connectionBatchingDelay: delay in milliseconds for batching filters for the same
188-
* endpoint connection
187+
* subscriptionMCWSFilterDelay: delay in milliseconds for batching filters for the same
188+
* endpoint connection. Smaller value = quicker display of realtime data (ex, 10ms in a
189+
* low latency environment), higher value = more efficient use of network bandwidth
190+
* (ex, 100ms+ in a high latency environment)
189191
*/
190-
connectionBatchingDelay: 100,
192+
subscriptionMCWSFilterDelay: 100,
191193

192194
/**
193195
* timeSystems: specify the time systems to use.

src/realtime/MCWSDataProductStreamProvider.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ import MCWSStreamProvider from './MCWSStreamProvider';
55
* @memberof {vista/telemetry}
66
*/
77
class MCWSDataProductStreamProvider extends MCWSStreamProvider {
8-
constructor(openmct, vistaTime, options) {
9-
super(openmct, vistaTime, options);
10-
this.options = options;
11-
}
12-
138
getUrl(domainObject) {
149
return domainObject.telemetry?.dataProductStreamUrl;
1510
}

src/realtime/MCWSStreamProvider.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ class MCWSStreamProvider {
2121
this.vistaTime = function () {
2222
return vistaTime;
2323
};
24+
this.options = options;
2425

2526
this.sessions = sessionService();
2627
this.filterService = filterService();
2728

2829
this.subscriptions = {};
2930
this.requests = {};
3031

31-
this.connectionBatchingDelay = options.time.connectionBatchingDelay || 100;
32+
this.subscriptionMCWSFilterDelay = options.time?.subscriptionMCWSFilterDelay ?? 100;
3233
}
3334

3435
processGlobalStaleness(data, latestTimestamp) {
@@ -92,9 +93,6 @@ class MCWSStreamProvider {
9293
return worker;
9394
}
9495

95-
// send connectionBatchingDelay to worker
96-
this.notifyWorker('connectionBatchingDelay', this.connectionBatchingDelay);
97-
9896
// topic
9997
const updateTopic = function (newValue) {
10098
this.notifyWorker('topic', newValue);

src/realtime/MCWSStreamWorkerScript.js

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@
2727
* @param {Object} extraFilterTerms additional filter terms
2828
* @param {Object} globalFilters global filters to apply
2929
*/
30-
constructor(url, property, topic, extraFilterTerms, globalFilters) {
30+
constructor(url, property, topic, extraFilterTerms, globalFilters, subscriptionMCWSFilterDelay) {
3131
this.url = url;
3232
this.topic = topic;
3333
this.subscribers = {};
3434
this.property = property;
3535
this.extraFilterTerms = extraFilterTerms;
3636
this.globalFilters = globalFilters;
37-
this.connectionBatchingDelay = 100;
37+
this.subscriptionMCWSFilterDelay = subscriptionMCWSFilterDelay ?? 100;
3838
}
3939

4040
/**
@@ -141,7 +141,7 @@
141141
this.pending = setTimeout(() => {
142142
this.pending = undefined;
143143
this.reconnect();
144-
}, this.connectionBatchingDelay);
144+
}, this.subscriptionMCWSFilterDelay);
145145
}
146146

147147
/**
@@ -238,7 +238,7 @@
238238
class MCWSStreamWorker {
239239
constructor() {
240240
this.connections = {};
241-
this.batchingDelay = 100; // Initialize with default value
241+
this.subscriptionMCWSFilterDelay = 100; // Initialize with default value
242242
}
243243

244244
/**
@@ -256,7 +256,7 @@
256256
this.activeTopic,
257257
extraFilterTerms,
258258
this.activeGlobalFilters,
259-
this.batchingDelay
259+
this.subscriptionMCWSFilterDelay
260260
);
261261
}
262262

@@ -290,15 +290,6 @@
290290
}
291291
}
292292

293-
/**
294-
* Set the connection batching delay for all connections
295-
* This should be called before any subscriptions are created
296-
* @param {Number} delay in milliseconds
297-
*/
298-
connectionBatchingDelay(delay) {
299-
this.batchingDelay = delay; // Store the delay for future connections
300-
}
301-
302293
/**
303294
* Change the current topic selection.
304295
* @param {Object} topic metadata about the selected topic

0 commit comments

Comments
 (0)