Add stop(Facet)

This commit is contained in:
Emery Hemingway 2024-03-19 15:37:49 +00:00
parent 399fd4a30c
commit 87e730bc5b
1 changed files with 3 additions and 0 deletions

View File

@ -633,6 +633,9 @@ proc stop*(turn: var Turn, facet: Facet) =
proc stop*(turn: var Turn) =
stop(turn, turn.facet)
proc stop*(facet: Facet) =
run(facet, stop)
proc onStop*(facet: Facet; act: TurnAction) =
## Add a `proc (turn: var Turn)` action to `facet` to be called as it stops.
add(facet.shutdownActions, act)