MCPcopy Index your code
hub / github.com/Effect-TS/effect / ["Micro"]

Method ["Micro"]

packages/effect/src/internal/fiberRuntime.ts:1131–1158  ·  view source on GitHub ↗
(op: Micro.Micro<any, any, never> & { _op: "Micro" })

Source from the content-addressed store, hash-verified

1129 }
1130
1131 ["Micro"](op: Micro.Micro<any, any, never> & { _op: "Micro" }) {
1132 return core.unsafeAsync<any, any>((microResume) => {
1133 let resume = microResume
1134 const fiber = Micro.runFork(Micro.provideContext(op, this.currentContext))
1135 fiber.addObserver((exit) => {
1136 if (exit._tag === "Success") {
1137 return resume(core.exitSucceed(exit.value))
1138 }
1139 switch (exit.cause._tag) {
1140 case "Interrupt": {
1141 return resume(core.exitFailCause(internalCause.interrupt(FiberId.none)))
1142 }
1143 case "Fail": {
1144 return resume(core.fail(exit.cause.error))
1145 }
1146 case "Die": {
1147 return resume(core.die(exit.cause.defect))
1148 }
1149 }
1150 })
1151 return core.unsafeAsync<void>((abortResume) => {
1152 resume = (_: any) => {
1153 abortResume(core.void)
1154 }
1155 fiber.unsafeInterrupt()
1156 })
1157 })
1158 }
1159
1160 [OpCodes.OP_SYNC](op: core.Primitive & { _op: OpCodes.OP_SYNC }) {
1161 const value = internalCall(() => op.effect_instruction_i0())

Callers

nothing calls this directly

Calls 6

unsafeInterruptMethod · 0.80
resumeFunction · 0.70
addObserverMethod · 0.65
failMethod · 0.65
dieMethod · 0.65
interruptMethod · 0.45

Tested by

no test coverage detected