mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-05-28 23:15:33 +08:00
refactor(websocket): move websocket logic to its own module
This commit is contained in:
16
server/modules/websocket/services/websocket-state.service.ts
Normal file
16
server/modules/websocket/services/websocket-state.service.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import type { RealtimeClientConnection } from '@/shared/types.js';
|
||||
|
||||
/**
|
||||
* Numeric readyState for an open WebSocket connection.
|
||||
*
|
||||
* We keep this in module state so services that broadcast updates do not need
|
||||
* to import `ws` directly just to compare open/closed state.
|
||||
*/
|
||||
export const WS_OPEN_STATE = 1;
|
||||
|
||||
/**
|
||||
* Shared registry of active chat WebSocket connections.
|
||||
*
|
||||
* Project/session services publish realtime updates by iterating this set.
|
||||
*/
|
||||
export const connectedClients = new Set<RealtimeClientConnection>();
|
||||
Reference in New Issue
Block a user