Add run(Ref, TurnAction) convenience proc
Developers shouldn't need to work with Facets directly.
This commit is contained in:
parent
6647aeb83b
commit
ef1290d105
|
@ -448,6 +448,10 @@ proc run*(facet; action: TurnAction; zombieTurn = false) =
|
||||||
action(turn)
|
action(turn)
|
||||||
run(turn.queues)
|
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) =
|
proc stop*(turn: var Turn, facet: Facet) =
|
||||||
enqueue(turn, facet.parent.get) do (turn: var Turn):
|
enqueue(turn, facet.parent.get) do (turn: var Turn):
|
||||||
facet.terminate(turn, true)
|
facet.terminate(turn, true)
|
||||||
|
|
Loading…
Reference in New Issue