@spfn/core 0.2.0-beta.51 → 0.2.0-beta.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -59,6 +59,12 @@ interface EventDef<TPayload = void> {
59
59
  * Called by job registration system
60
60
  */
61
61
  _registerJobQueue: (queueName: string, sender: JobQueueSender) => void;
62
+ /**
63
+ * Internal: Drop the cache binding (cache + subscribed flag).
64
+ * Called by the event cache transport on shutdown so a later useCache can
65
+ * rebind a fresh cache in the same process.
66
+ */
67
+ _resetCache: () => void;
62
68
  /**
63
69
  * Type inference helper
64
70
  */
@@ -1,5 +1,5 @@
1
1
  import { Context } from 'hono';
2
- import { a as EventDef, E as EventRouterDef, h as SSETokenStore, S as SSETokenManager, I as InferEventNames, b as InferEventPayload } from './token-manager-CyG7la3p.js';
2
+ import { a as EventDef, E as EventRouterDef, h as SSETokenStore, S as SSETokenManager, I as InferEventNames, b as InferEventPayload } from './token-manager-C2Ag5-s8.js';
3
3
 
4
4
  /**
5
5
  * WebSocket Types
@@ -83,6 +83,24 @@ interface WSHandlerConfig {
83
83
  * @default 30000
84
84
  */
85
85
  pingInterval?: number;
86
+ /**
87
+ * Cross-pod event broadcast via the cache (Redis/Valkey) pub/sub.
88
+ *
89
+ * When `true` (default) and a cache is configured (`CACHE_URL`), each event
90
+ * is auto-wired so an `emit` on one pod reaches subscribers on every pod.
91
+ * Without a cache this is a no-op (events stay in-process). Set `false` to
92
+ * force in-process even when a cache is present.
93
+ *
94
+ * @default true
95
+ */
96
+ multiInstance?: boolean;
97
+ /**
98
+ * Pub/sub channel prefix for cross-pod broadcast.
99
+ *
100
+ * Defaults to env `SPFN_SSE_CHANNEL_PREFIX`, else `spfn:sse:`. Use distinct
101
+ * prefixes to isolate apps/tenants that share one Redis instance.
102
+ */
103
+ channelPrefix?: string;
86
104
  /**
87
105
  * Authentication and authorization configuration
88
106
  */
@@ -1,5 +1,5 @@
1
1
  import { Context } from 'hono';
2
- import { h as SSETokenStore, S as SSETokenManager, E as EventRouterDef, I as InferEventNames, b as InferEventPayload } from './token-manager-CyG7la3p.js';
2
+ import { h as SSETokenStore, S as SSETokenManager, E as EventRouterDef, I as InferEventNames, b as InferEventPayload } from './token-manager-C2Ag5-s8.js';
3
3
 
4
4
  /**
5
5
  * SSE Types
@@ -120,13 +120,38 @@ interface SSEAuthConfig<TRouter extends EventRouterDef<any>> {
120
120
  interface SSEHandlerConfig {
121
121
  /**
122
122
  * Keep-alive ping interval in milliseconds
123
- * @default 30000
123
+ * @default 10000
124
124
  */
125
125
  pingInterval?: number;
126
126
  /**
127
127
  * Custom headers for SSE response
128
128
  */
129
129
  headers?: Record<string, string>;
130
+ /**
131
+ * Max outbound frames buffered per connection before a slow consumer is
132
+ * dropped (connection closed). Bounds memory under a fast producer + slow
133
+ * client; the client reconnects rather than receiving corrupted/partial data.
134
+ * @default 1000
135
+ */
136
+ maxQueue?: number;
137
+ /**
138
+ * Cross-pod event broadcast via the cache (Redis/Valkey) pub/sub.
139
+ *
140
+ * When `true` (default) and a cache is configured (`CACHE_URL`), each event
141
+ * is auto-wired so an `emit` on one pod reaches subscribers on every pod.
142
+ * Without a cache this is a no-op (events stay in-process). Set `false` to
143
+ * force in-process even when a cache is present.
144
+ *
145
+ * @default true
146
+ */
147
+ multiInstance?: boolean;
148
+ /**
149
+ * Pub/sub channel prefix for cross-pod broadcast.
150
+ *
151
+ * Defaults to env `SPFN_SSE_CHANNEL_PREFIX`, else `spfn:sse:`. Use distinct
152
+ * prefixes to isolate apps/tenants that share one Redis instance.
153
+ */
154
+ channelPrefix?: string;
130
155
  /**
131
156
  * Authentication and authorization configuration
132
157
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spfn/core",
3
- "version": "0.2.0-beta.51",
3
+ "version": "0.2.0-beta.52",
4
4
  "description": "SPFN Framework Core - File-based routing, transactions, repository pattern",
5
5
  "type": "module",
6
6
  "exports": {