fix: add stop() to IRelayAPI and IStore interfaces, implement in SDK wrappers

This commit is contained in:
Levente Kiss 2025-10-31 19:09:27 +13:00 committed by fryorcraken
parent a97e7eceb9
commit dd1977455d
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
4 changed files with 7 additions and 0 deletions

View File

@ -16,6 +16,7 @@ export interface IRelayAPI {
readonly pubsubTopics: Set<PubsubTopic>;
readonly gossipSub: GossipSub;
start: () => Promise<void>;
stop: () => Promise<void>;
waitForPeers: () => Promise<void>;
getMeshPeers: (topic?: TopicStr) => PeerIdStr[];
}

View File

@ -99,6 +99,7 @@ export type QueryRequestParams = {
export type IStore = {
readonly multicodec: string;
stop(): void;
createCursor(message: IDecodedMessage): StoreCursor;
queryGenerator: <T extends IDecodedMessage>(
decoders: IDecoder<T>[],

View File

@ -65,6 +65,7 @@ export class LightPush implements ILightPush {
public stop(): void {
this.retryManager.stop();
this.protocol.stop();
}
public async send(

View File

@ -46,6 +46,10 @@ export class Store implements IStore {
return this.protocol.multicodec;
}
public stop(): void {
this.protocol.stop();
}
/**
* Queries the Waku Store for historical messages using the provided decoders and options.
* Returns an asynchronous generator that yields promises of decoded messages.