* Remove SSE connection from project
(projectId: string, controller: ReadableStreamDefaultController)
| 42 | * Remove SSE connection from project |
| 43 | */ |
| 44 | public removeStream(projectId: string, controller: ReadableStreamDefaultController): void { |
| 45 | const projectStreams = this.streams.get(projectId); |
| 46 | if (projectStreams) { |
| 47 | projectStreams.delete(controller); |
| 48 | |
| 49 | if (projectStreams.size === 0) { |
| 50 | this.streams.delete(projectId); |
| 51 | } |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Send event to all clients of a project |