rename SubscriptionManager to Subscription

This commit is contained in:
Sasha 2024-10-27 18:36:39 +01:00
parent 09127dfc91
commit 2a5df25ca9
No known key found for this signature in database
2 changed files with 7 additions and 8 deletions

View File

@ -26,7 +26,7 @@ import {
import { PeerManager } from "../peer_manager.js";
import { MessageCache } from "./message_cache.js";
import { SubscriptionManager } from "./subscription_manager.js";
import { Subscription } from "./subscription.js";
import { buildConfig } from "./utils.js";
const log = new Logger("sdk:filter");
@ -36,7 +36,7 @@ class Filter implements IFilter {
private readonly config: FilterProtocolOptions;
private readonly messageCache: MessageCache;
private activeSubscriptions = new Map<string, SubscriptionManager>();
private activeSubscriptions = new Map<string, Subscription>();
public constructor(
private connectionManager: ConnectionManager,
@ -186,7 +186,7 @@ class Filter implements IFilter {
this.getActiveSubscription(pubsubTopic) ??
this.setActiveSubscription(
pubsubTopic,
new SubscriptionManager(
new Subscription(
pubsubTopic,
this.protocol,
this.connectionManager,
@ -263,17 +263,16 @@ class Filter implements IFilter {
return toAsyncIterator(this, decoders);
}
//TODO: move to SubscriptionManager
private getActiveSubscription(
pubsubTopic: PubsubTopic
): SubscriptionManager | undefined {
): Subscription | undefined {
return this.activeSubscriptions.get(pubsubTopic);
}
private setActiveSubscription(
pubsubTopic: PubsubTopic,
subscription: SubscriptionManager
): SubscriptionManager {
subscription: Subscription
): Subscription {
this.activeSubscriptions.set(pubsubTopic, subscription);
return subscription;
}

View File

@ -36,7 +36,7 @@ import { DEFAULT_LIGHT_PUSH_FILTER_CHECK_INTERVAL } from "./constants.js";
const log = new Logger("sdk:filter:subscription_manager");
export class SubscriptionManager implements ISubscription {
export class Subscription implements ISubscription {
private reliabilityMonitor: ReceiverReliabilityMonitor;
private keepAliveTimeout: number;