mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-08 00:33:12 +00:00
fix: add stop() to IRelayAPI and IStore interfaces, implement in SDK wrappers
This commit is contained in:
parent
a97e7eceb9
commit
dd1977455d
@ -16,6 +16,7 @@ export interface IRelayAPI {
|
|||||||
readonly pubsubTopics: Set<PubsubTopic>;
|
readonly pubsubTopics: Set<PubsubTopic>;
|
||||||
readonly gossipSub: GossipSub;
|
readonly gossipSub: GossipSub;
|
||||||
start: () => Promise<void>;
|
start: () => Promise<void>;
|
||||||
|
stop: () => Promise<void>;
|
||||||
waitForPeers: () => Promise<void>;
|
waitForPeers: () => Promise<void>;
|
||||||
getMeshPeers: (topic?: TopicStr) => PeerIdStr[];
|
getMeshPeers: (topic?: TopicStr) => PeerIdStr[];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,6 +99,7 @@ export type QueryRequestParams = {
|
|||||||
export type IStore = {
|
export type IStore = {
|
||||||
readonly multicodec: string;
|
readonly multicodec: string;
|
||||||
|
|
||||||
|
stop(): void;
|
||||||
createCursor(message: IDecodedMessage): StoreCursor;
|
createCursor(message: IDecodedMessage): StoreCursor;
|
||||||
queryGenerator: <T extends IDecodedMessage>(
|
queryGenerator: <T extends IDecodedMessage>(
|
||||||
decoders: IDecoder<T>[],
|
decoders: IDecoder<T>[],
|
||||||
|
|||||||
@ -65,6 +65,7 @@ export class LightPush implements ILightPush {
|
|||||||
|
|
||||||
public stop(): void {
|
public stop(): void {
|
||||||
this.retryManager.stop();
|
this.retryManager.stop();
|
||||||
|
this.protocol.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async send(
|
public async send(
|
||||||
|
|||||||
@ -46,6 +46,10 @@ export class Store implements IStore {
|
|||||||
return this.protocol.multicodec;
|
return this.protocol.multicodec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public stop(): void {
|
||||||
|
this.protocol.stop();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Queries the Waku Store for historical messages using the provided decoders and options.
|
* Queries the Waku Store for historical messages using the provided decoders and options.
|
||||||
* Returns an asynchronous generator that yields promises of decoded messages.
|
* Returns an asynchronous generator that yields promises of decoded messages.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user