MCPcopy Create free account
hub / github.com/tiann/hapi / constructor

Method constructor

hub/src/sync/syncEngine.ts:137–155  ·  view source on GitHub ↗
(
        private readonly store: Store,
        io: Server,
        rpcRegistry: RpcRegistry,
        sseManager: SSEManager
    )

Source from the content-addressed store, hash-verified

135 private inactivityTimer: NodeJS.Timeout | null = null
136
137 constructor(
138 private readonly store: Store,
139 io: Server,
140 rpcRegistry: RpcRegistry,
141 sseManager: SSEManager
142 ) {
143 this.eventPublisher = new EventPublisher(sseManager, (event) => this.resolveNamespace(event))
144 this.sessionCache = new SessionCache(store, this.eventPublisher)
145 this.machineCache = new MachineCache(store, this.eventPublisher)
146 this.messageService = new MessageService(
147 store,
148 io,
149 this.eventPublisher,
150 (sessionId, updatedAt) => this.recordSessionActivity(sessionId, updatedAt)
151 )
152 this.rpcGateway = new RpcGateway(io, rpcRegistry)
153 this.reloadAll()
154 this.inactivityTimer = setInterval(() => this.expireInactive(), 5_000)
155 }
156
157 stop(): void {
158 if (this.inactivityTimer) {

Callers

nothing calls this directly

Calls 4

resolveNamespaceMethod · 0.95
recordSessionActivityMethod · 0.95
reloadAllMethod · 0.95
expireInactiveMethod · 0.95

Tested by

no test coverage detected