(envelope: PersistedStreamEventEnvelope)
| 124 | } |
| 125 | |
| 126 | private enqueue(envelope: PersistedStreamEventEnvelope): void { |
| 127 | if (this._clientDisconnected || !this.controller) return |
| 128 | try { |
| 129 | this.controller.enqueue(encodeSSEEnvelope(envelope)) |
| 130 | } catch (error) { |
| 131 | this._clientDisconnected = true |
| 132 | logger.warn('Envelope enqueue failed, marking client disconnected', { |
| 133 | streamId: this.streamId, |
| 134 | requestId: this.requestId, |
| 135 | seq: envelope.seq, |
| 136 | error: toError(error).message, |
| 137 | }) |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | private createEnvelope(event: StreamEvent): PersistedStreamEventEnvelope { |
| 142 | const seq = ++this.nextSeq |
no test coverage detected