SSE Session and examples
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user