Skip to content

Class: SubscriptionManager

Defined in: packages/core/src/resource/SubscriptionManager.ts:27

Constructors

Constructor

ts
new SubscriptionManager(): SubscriptionManager;

Returns

SubscriptionManager

Accessors

size

Get Signature

ts
get size(): number;

Defined in: packages/core/src/resource/SubscriptionManager.ts:97

Number of active subscriptions.

Returns

number

Methods

clear()

ts
clear(): void;

Defined in: packages/core/src/resource/SubscriptionManager.ts:100

Remove all subscriptions.

Returns

void


getSubscriptions()

ts
getSubscriptions(): ReadonlySet<string>;

Defined in: packages/core/src/resource/SubscriptionManager.ts:61

Get all currently subscribed URIs.

Returns

ReadonlySet<string>


isSubscribed()

ts
isSubscribed(uri): boolean;

Defined in: packages/core/src/resource/SubscriptionManager.ts:54

Check if a URI is currently subscribed.

Parameters

ParameterTypeDescription
uristringThe URI to check

Returns

boolean


notify()

ts
notify(uri): Promise<void>;

Defined in: packages/core/src/resource/SubscriptionManager.ts:73

Emit a notifications/resources/updated for a URI.

Only emits if the URI is subscribed AND a sink is configured. Errors in the sink are swallowed (best-effort delivery).

Parameters

ParameterTypeDescription
uristringThe URI of the resource that changed

Returns

Promise<void>


subscribe()

ts
subscribe(uri): void;

Defined in: packages/core/src/resource/SubscriptionManager.ts:36

Subscribe to push notifications for a resource URI.

Parameters

ParameterTypeDescription
uristringThe resource URI to subscribe to

Returns

void


unsubscribe()

ts
unsubscribe(uri): void;

Defined in: packages/core/src/resource/SubscriptionManager.ts:45

Unsubscribe from push notifications for a resource URI.

Parameters

ParameterTypeDescription
uristringThe resource URI to unsubscribe from

Returns

void