Sasha f199d92d60
feat: migrate to latest LightPush version (#2281)
* 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
2025-02-25 22:40:03 +01:00

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>;
}