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

Method reportExitValue

packages/effect/src/internal/fiberRuntime.ts:820–844  ·  view source on GitHub ↗
(exit: Exit.Exit<A, E>)

Source from the content-addressed store, hash-verified

818 }
819
820 reportExitValue(exit: Exit.Exit<A, E>) {
821 if (runtimeFlags_.runtimeMetrics(this.currentRuntimeFlags)) {
822 const tags = this.getFiberRef(core.currentMetricLabels)
823 const startTimeMillis = this.id().startTimeMillis
824 const endTimeMillis = Date.now()
825 fiberLifetimes.unsafeUpdate(endTimeMillis - startTimeMillis, tags)
826 fiberActive.unsafeUpdate(-1, tags)
827 switch (exit._tag) {
828 case OpCodes.OP_SUCCESS: {
829 fiberSuccesses.unsafeUpdate(1, tags)
830 break
831 }
832 case OpCodes.OP_FAILURE: {
833 fiberFailures.unsafeUpdate(1, tags)
834 break
835 }
836 }
837 }
838 if (exit._tag === "Failure") {
839 const level = this.getFiberRef(core.currentUnhandledErrorLogLevel)
840 if (!internalCause.isInterruptedOnly(exit.cause) && level._tag === "Some") {
841 this.log("Fiber terminated with an unhandled error", exit.cause, level)
842 }
843 }
844 }
845
846 setExitValue(exit: Exit.Exit<A, E>) {
847 this._exitValue = exit

Callers 1

setExitValueMethod · 0.95

Calls 5

getFiberRefMethod · 0.95
idMethod · 0.95
logMethod · 0.95
unsafeUpdateMethod · 0.80
nowMethod · 0.45

Tested by

no test coverage detected