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

Method fork

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

Source from the content-addressed store, hash-verified

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

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