MCPcopy Create free account
hub / github.com/Effect-TS/effect / emit

Function emit

packages/effect/src/unstable/workers/Worker.ts:206–216  ·  view source on GitHub ↗
(data: PlatformMessage)

Source from the content-addressed store, hash-verified

204 port,
205 scope,
206 emit(data: PlatformMessage) {
207 if (data[0] === 0) {
208 if (opts?.onSpawn) {
209 run(Effect.ensuring(opts.onSpawn, ready.open))
210 } else {
211 ready.openUnsafe()
212 }
213 return
214 }
215 run(handler(data[1] as O))
216 },
217 deferred: fiberSet.deferred as any
218 })
219 yield* ready.await

Callers

nothing calls this directly

Calls 3

runFunction · 0.70
openUnsafeMethod · 0.65
handlerFunction · 0.50

Tested by

no test coverage detected