Add policy for deferring messages when auth has failed

This commit is contained in:
Jon Staab
2025-03-21 14:12:50 -07:00
parent be3ce11110
commit 62f0caff1d
6 changed files with 221 additions and 97 deletions
+12 -1
View File
@@ -1,6 +1,17 @@
import {remove} from "@welshman/lib"
import {normalizeRelayUrl} from "@welshman/util"
import {Socket, makeSocket} from "./socket.js"
import {Socket} from "./socket.js"
import {defaultSocketPolicies} from "./policy.js"
export const makeSocket = (url: string, policies = defaultSocketPolicies) => {
const socket = new Socket(url)
for (const applyPolicy of defaultSocketPolicies) {
applyPolicy(socket)
}
return socket
}
export type PoolSubscription = (socket: Socket) => void