MCPcopy Index your code
hub / github.com/Effect-TS/effect / fork

Method fork

packages/effect/src/Micro.ts:3363–3377  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3361 })
3362 }
3363 get fork() {
3364 return sync(() => {
3365 const newScope = new MicroScopeImpl()
3366 if (this.state._tag === "Closed") {
3367 newScope.state = this.state
3368 return newScope
3369 }
3370 function fin(exit: MicroExit<any, any>) {
3371 return newScope.close(exit)
3372 }
3373 this.state.finalizers.add(fin)
3374 newScope.unsafeAddFinalizer((_) => sync(() => this.unsafeRemoveFinalizer(fin)))
3375 return newScope
3376 })
3377 }
3378}
3379
3380/**

Callers

nothing calls this directly

Calls 4

unsafeAddFinalizerMethod · 0.95
unsafeRemoveFinalizerMethod · 0.95
addMethod · 0.65
syncFunction · 0.50

Tested by

no test coverage detected