Skip to content

Commit c86730c

Browse files
committed
property pass in configured delay and handle defaults
1 parent a7fdea0 commit c86730c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/realtime/MCWSStreamProvider.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ class MCWSStreamProvider {
217217
key: this.getKey(domainObject),
218218
property: this.getProperty(domainObject),
219219
mcwsVersion: domainObject.telemetry.mcwsVersion,
220-
extraFilterTerms: options?.filters ? this.serializeFilters(options.filters) : undefined
220+
extraFilterTerms: options?.filters ? this.serializeFilters(options.filters) : undefined,
221+
subscriptionMCWSFilterDelay: this.subscriptionMCWSFilterDelay
221222
};
222223

223224
function unsubscribe() {

src/realtime/MCWSStreamWorkerScript.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,15 +238,14 @@
238238
class MCWSStreamWorker {
239239
constructor() {
240240
this.connections = {};
241-
this.subscriptionMCWSFilterDelay = 100; // Initialize with default value
242241
}
243242

244243
/**
245244
* Add a new active subscription.
246245
* @param {MCWSStreamSubscription} subscription the subscription to obtain
247246
*/
248247
subscribe(subscription) {
249-
const { url, key, property, extraFilterTerms } = subscription;
248+
const { url, key, property, extraFilterTerms, subscriptionMCWSFilterDelay } = subscription;
250249
const cacheKey = this.generateCacheKey(url, property, extraFilterTerms);
251250

252251
if (!this.connections[cacheKey]) {
@@ -256,7 +255,7 @@
256255
this.activeTopic,
257256
extraFilterTerms,
258257
this.activeGlobalFilters,
259-
this.subscriptionMCWSFilterDelay
258+
subscriptionMCWSFilterDelay
260259
);
261260
}
262261

0 commit comments

Comments
 (0)