MCPcopy Index your code
hub / github.com/anomalyco/opencode / readEvent

Function readEvent

packages/opencode/test/server/httpapi-event.test.ts:15–24  ·  view source on GitHub ↗
(reader: Queue.Dequeue<Uint8Array>)

Source from the content-addressed store, hash-verified

13})
14
15const readEvent = (reader: Queue.Dequeue<Uint8Array>) =>
16 Effect.gen(function* () {
17 const value = yield* Queue.take(reader).pipe(
18 Effect.timeoutOrElse({
19 duration: "5 seconds",
20 orElse: () => Effect.fail(new Error("timed out waiting for event")),
21 }),
22 )
23 return Schema.decodeUnknownSync(EventData)(JSON.parse(new TextDecoder().decode(value).replace(/^data: /, "")))
24 })
25
26const openEventStream = (directory: string) =>
27 Effect.gen(function* () {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected