Replace mutable handles in-place

This commit is contained in:
Emery Hemingway 2022-05-21 13:21:02 -05:00
parent 9648884997
commit 9048506981
2 changed files with 7 additions and 1 deletions

View File

@ -291,6 +291,12 @@ proc replace*[T](turn: var Turn; `ref`: Ref; h: Handle; v: T): Handle =
result = publish(turn, `ref`, v)
retract(turn, h)
proc replace*[T](turn: var Turn; `ref`: Ref; h: var Handle; v: T): Handle {.discardable.} =
var old = h
h = publish(turn, `ref`, v)
retract(turn, old)
h
proc stop*(turn: var Turn) {.gcsafe.}
proc run*(facet; action: TurnAction; zombieTurn = false) {.gcsafe.}

View File

@ -1,6 +1,6 @@
# Package
version = "1.3.0"
version = "1.3.1"
author = "Emery Hemingway"
description = "Syndicated actors for conversational concurrency"
license = "Unlicense"