Feat(SSE): SSE Session auto-reconnect
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { BaseStore } from './base-store.js';
|
||||
import { SSEClient } from '../utils/index.js';
|
||||
import { SSESession } from '../utils/index.js';
|
||||
import {
|
||||
Bytes,
|
||||
Encrypter,
|
||||
@@ -96,7 +96,7 @@ export class StoreRemoteHTTP extends BaseStore {
|
||||
// NOTE: SSE only supports text-encoding, so we use Extended JSON instead of msgpackr (which is binary).
|
||||
// TODO: It would be really nice to somehow be able to support msgpackr for consistency though.
|
||||
// But, from a bandwidth point of view, this is not crucial: These payloads are "live" payloads (thus, there's not much data).
|
||||
await SSEClient.from(`${this.baseURL}events`, {
|
||||
await SSESession.from(`${this.baseURL}events`, {
|
||||
method: 'POST',
|
||||
headers,
|
||||
onMessage: (e) => {
|
||||
|
||||
Reference in New Issue
Block a user