Add run(Ref, TurnAction) convenience proc

Developers shouldn't need to work with Facets directly.
This commit is contained in:
Emery Hemingway 2022-07-08 07:50:10 -05:00
parent 6647aeb83b
commit ef1290d105
1 changed files with 4 additions and 0 deletions

View File

@ -448,6 +448,10 @@ proc run*(facet; action: TurnAction; zombieTurn = false) =
action(turn)
run(turn.queues)
proc run*(`ref`: Ref; action: TurnAction) =
## Convenience proc to run a `TurnAction` in the scope of a `Ref`.
run(`ref`.relay, action)
proc stop*(turn: var Turn, facet: Facet) =
enqueue(turn, facet.parent.get) do (turn: var Turn):
facet.terminate(turn, true)