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

Function commitTransaction

packages/effect/src/Effect.ts:16496–16508  ·  view source on GitHub ↗
(fiber: Fiber<unknown, unknown>, state: TransactionMeta)

Source from the content-addressed store, hash-verified

16494}
16495
16496function commitTransaction(fiber: Fiber<unknown, unknown>, state: TransactionMeta) {
16497 for (const [ref, { value, written }] of state.journal) {
16498 if (!written) continue
16499 if (!Object.is(value, ref.value)) {
16500 ref.version = ref.version + 1
16501 ref.value = value
16502 }
16503 for (const pending of ref.pending.values()) {
16504 fiber.currentDispatcher.scheduleTask(pending, 0)
16505 }
16506 ref.pending.clear()
16507 }
16508}
16509
16510function clearTransaction(state: TransactionMetaInner) {
16511 state.retry = false

Callers 1

stepFunction · 0.85

Calls 3

isMethod · 0.65
scheduleTaskMethod · 0.65
clearMethod · 0.65

Tested by

no test coverage detected