SSE Session and examples

This commit is contained in:
2026-09-17 07:51:48 +00:00
committed by Kuldeep
parent e96ab6457b
commit 752cda0706
16 changed files with 2306 additions and 4 deletions
+23
View File
@@ -32,3 +32,26 @@ export const SSE_TRAILING_NEWLINE_REGEX = /\n$/;
* buffered partial lines between streamed chunks before the next parse call.
*/
export const NEW_LINE = '\n';
/**
* Default exponential backoff options for the SSE session.
*/
export const SSE_SESSION_EXPONENTIAL_BACKOFF_DEFAULTS = {
baseDelay: 250,
maxDelay: 10000,
maxAttempts: 0,
growthRate: 1.3,
jitter: 0.3,
} as const;
/**
* Default attempt reconnect flag for the SSE session.
* @default true
*/
export const SSE_SESSION_ATTEMPT_RECONNECT_DEFAULT = true;
/**
* Default persistent flag for the SSE session.
* @default false
*/
export const SSE_SESSION_PERSISTENT_DEFAULT = false;