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

Function openEventStream

packages/opencode/test/server/httpapi-event.test.ts:26–35  ·  view source on GitHub ↗
(directory: string)

Source from the content-addressed store, hash-verified

24 })
25
26const openEventStream = (directory: string) =>
27 Effect.gen(function* () {
28 const response = yield* requestInDirectory(EventPaths.event, directory)
29 const reader = yield* Queue.unbounded<Uint8Array>()
30 yield* response.stream.pipe(
31 Stream.runForEach((value) => Queue.offer(reader, value)),
32 Effect.forkScoped,
33 )
34 return { response, reader }
35 })
36
37afterEach(async () => {
38 await disposeAllInstances()

Callers 1

Calls 1

requestInDirectoryFunction · 0.90

Tested by

no test coverage detected