mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-14 19:53:12 +00:00
* create retry manager * update tests * add retry manager tests, update peer manager * fix start & merge with master * return send to many logic * add new error handling * add sections to protocol errors * fix check * up test * add waku.start in test * fix check and test * improve name
25 lines
516 B
TypeScript
25 lines
516 B
TypeScript
import type { IEncoder, IMessage } from "./message.js";
|
|
import { SDKProtocolResult } from "./protocols.js";
|
|
|
|
export type ISendOptions = {
|
|
/**
|
|
* Enables retry of a message that was failed to be sent.
|
|
* @default true
|
|
*/
|
|
autoRetry?: boolean;
|
|
|
|
/**
|
|
* Sets number of attempts if `autoRetry` is enabled.
|
|
* @default 3
|
|
*/
|
|
maxAttempts?: number;
|
|
};
|
|
|
|
export interface ISender {
|
|
send: (
|
|
encoder: IEncoder,
|
|
message: IMessage,
|
|
sendOptions?: ISendOptions
|
|
) => Promise<SDKProtocolResult>;
|
|
}
|