-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into chore/libp2p-v2
- Loading branch information
Showing
18 changed files
with
467 additions
and
365 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import { IBaseProtocolCore, IBaseProtocolSDK } from "./protocols.js"; | ||
import { IBaseProtocolCore } from "./protocols.js"; | ||
import type { ISender } from "./sender.js"; | ||
|
||
export type ILightPush = ISender & | ||
IBaseProtocolSDK & { protocol: IBaseProtocolCore }; | ||
export type ILightPush = ISender & { protocol: IBaseProtocolCore }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
import type { IEncoder, IMessage } from "./message.js"; | ||
import { ProtocolUseOptions, SDKProtocolResult } from "./protocols.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?: ProtocolUseOptions | ||
sendOptions?: ISenderOptions | ||
) => Promise<SDKProtocolResult>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
export const DEFAULT_KEEP_ALIVE = 60_000; | ||
export const DEFAULT_LIGHT_PUSH_FILTER_CHECK = false; | ||
export const DEFAULT_LIGHT_PUSH_FILTER_CHECK_INTERVAL = 10_000; | ||
|
||
export const DEFAULT_SUBSCRIBE_OPTIONS = { | ||
keepAlive: DEFAULT_KEEP_ALIVE | ||
keepAlive: DEFAULT_KEEP_ALIVE, | ||
enableLightPushFilterCheck: DEFAULT_LIGHT_PUSH_FILTER_CHECK | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.