Sasha 4049123f14
feat!: lighten retry logic for LightPush (#2182)
* feat: lighten retry logic for LightPush

* update tests

* remove base protocol sdk from light push, add unit tests for light push

* remove replaced test

* ensure numPeersToUse is respected

* skip tests
2024-10-17 00:49:24 +02:00

24 lines
520 B
TypeScript

import type { IEncoder, IMessage } from "./message.js";
import { SDKProtocolResult } from "./protocols.js";
export type ISenderOptions = {
/**
* Enables retry of a message that was failed to be sent.
* @default false
*/
autoRetry?: boolean;
/**
* Sets number of attempts if `autoRetry` is enabled.
* @default 3
*/
maxAttempts?: number;
};
export interface ISender {
send: (
encoder: IEncoder,
message: IMessage,
sendOptions?: ISenderOptions
) => Promise<SDKProtocolResult>;
}