MCPcopy Create free account
hub / github.com/cloudflare/computer / emitLine

Function emitLine

packages/computer/src/exec-wire.ts:109–116  ·  view source on GitHub ↗
(
    line: string,
    controller: TransformStreamDefaultController<WorkspaceExecEvent<E>>,
  )

Source from the content-addressed store, hash-verified

107 const decoder = new TextDecoder("utf-8");
108 let buffer = "";
109 const emitLine = (
110 line: string,
111 controller: TransformStreamDefaultController<WorkspaceExecEvent<E>>,
112 ) => {
113 if (line.length === 0) return;
114 const frame = JSON.parse(line) as ExecFrame;
115 controller.enqueue(eventOf(frame) as WorkspaceExecEvent<E>);
116 };
117 return bytes.pipeThrough(
118 new TransformStream<Uint8Array, WorkspaceExecEvent<E>>({
119 transform(chunk, controller) {

Callers 2

transformFunction · 0.85
flushFunction · 0.85

Calls 1

eventOfFunction · 0.85

Tested by

no test coverage detected