Skip to content

Commit 0b01450

Browse files
committed
fix: add stop() to IRelayAPI and IStore interfaces, implement in SDK wrappers
1 parent 5b17237 commit 0b01450

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

packages/interfaces/src/relay.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export interface IRelayAPI {
1616
readonly pubsubTopics: Set<PubsubTopic>;
1717
readonly gossipSub: GossipSub;
1818
start: () => Promise<void>;
19+
stop: () => Promise<void>;
1920
waitForPeers: () => Promise<void>;
2021
getMeshPeers: (topic?: TopicStr) => PeerIdStr[];
2122
}

packages/interfaces/src/store.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ export type QueryRequestParams = {
9999
export type IStore = {
100100
readonly multicodec: string;
101101

102+
stop(): void;
102103
createCursor(message: IDecodedMessage): StoreCursor;
103104
queryGenerator: <T extends IDecodedMessage>(
104105
decoders: IDecoder<T>[],

packages/sdk/src/light_push/light_push.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export class LightPush implements ILightPush {
6565

6666
public stop(): void {
6767
this.retryManager.stop();
68+
this.protocol.stop();
6869
}
6970

7071
public async send(

packages/sdk/src/store/store.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ export class Store implements IStore {
4646
return this.protocol.multicodec;
4747
}
4848

49+
public stop(): void {
50+
this.protocol.stop();
51+
}
52+
4953
/**
5054
* Queries the Waku Store for historical messages using the provided decoders and options.
5155
* Returns an asynchronous generator that yields promises of decoded messages.

0 commit comments

Comments
 (0)