MCPcopy
hub / github.com/simstudioai/sim / IRoomManager

Interface IRoomManager

apps/realtime/src/rooms/types.ts:43–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41 * All methods that access state are async to support Redis operations
42 */
43export interface IRoomManager {
44 readonly io: Server
45
46 /**
47 * Initialize the room manager (connect to Redis, etc.)
48 */
49 initialize(): Promise<void>
50
51 /**
52 * Whether the room manager is ready to serve requests
53 */
54 isReady(): boolean
55
56 /**
57 * Clean shutdown
58 */
59 shutdown(): Promise<void>
60
61 /**
62 * Add a user to a workflow room
63 */
64 addUserToRoom(workflowId: string, socketId: string, presence: UserPresence): Promise<void>
65
66 /**
67 * Remove a user from their current room
68 * Optional workflowIdHint is used when socket mapping keys are missing/expired.
69 * Returns the workflowId they were in, or null if not in any room.
70 */
71 removeUserFromRoom(socketId: string, workflowIdHint?: string): Promise<string | null>
72
73 /**
74 * Get the workflow ID for a socket
75 */
76 getWorkflowIdForSocket(socketId: string): Promise<string | null>
77
78 /**
79 * Get user session data for a socket
80 */
81 getUserSession(socketId: string): Promise<UserSession | null>
82
83 /**
84 * Get all users in a workflow room
85 */
86 getWorkflowUsers(workflowId: string): Promise<UserPresence[]>
87
88 /**
89 * Check if a workflow room exists
90 */
91 hasWorkflowRoom(workflowId: string): Promise<boolean>
92
93 /**
94 * Update user activity (cursor, selection, lastActivity)
95 */
96 updateUserActivity(
97 workflowId: string,
98 socketId: string,
99 updates: Partial<Pick<UserPresence, 'cursor' | 'selection' | 'lastActivity'>>
100 ): Promise<void>

Callers 52

initializeProvidersFunction · 0.65
renderFunction · 0.65
index.test.tsFile · 0.65
createHttpHandlerFunction · 0.65
setupVariablesHandlersFunction · 0.65
setupSubblocksHandlersFunction · 0.65
setupOperationsHandlersFunction · 0.65
setupWorkflowHandlersFunction · 0.65
shutdownOtelFunction · 0.65
shutdownPostHogFunction · 0.65
index.test.tsFile · 0.65
shutdownFunction · 0.65

Implementers 2

RedisRoomManagerapps/realtime/src/rooms/redis-manager.
MemoryRoomManagerapps/realtime/src/rooms/memory-manager

Calls

no outgoing calls

Tested by

no test coverage detected