MCPcopy Index your code
hub / github.com/simstudioai/sim / enqueue

Method enqueue

apps/sim/lib/copilot/request/session/writer.ts:126–139  ·  view source on GitHub ↗
(envelope: PersistedStreamEventEnvelope)

Source from the content-addressed store, hash-verified

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

Callers 1

publishMethod · 0.95

Calls 4

encodeSSEEnvelopeFunction · 0.90
toErrorFunction · 0.90
enqueueMethod · 0.65
warnMethod · 0.65

Tested by

no test coverage detected