def finish

bendvy-ecs-core@0.1.0.4 · transaction.bend:83

import bendvy-ecs-core@0.1.0.4/transaction.bend as Transaction
import Base
import bendvy-ecs-core@0.1.0.4/deferred_command.bend as Deferred

83# Consume the transaction and return World with its decision. Success
84# enqueues commands then publishes Data events in authored order; failure
85# runs the inverse journal newest first and publishes/enqueues neither.
86# enqueue/publish are trusted callbacks; arbitrary external effects are outside
87# this guarantee. This function does not execute the deferred command barrier.
88def finish(~W: Type, ~E: Data, ~Error: Data,
89  ~enqueue: W -> List<&1,Deferred.Command<W>> -> W,
90  ~publish: W -> List<&2, E> -> W,
91  tx: Tx<W, E>, outcome: Outcome<Error>
92) -> Returned<W, Error>:
93  match tx:
94    case Tx{world, undo, commands, events,trace}:
95      finish_world(~W, ~E, ~Error, ~enqueue, ~publish, world, undo, commands, events, outcome)

Uses (6)

Used by (2)