Tidy dataspaces module

This commit is contained in:
Emery Hemingway 2022-10-26 18:58:32 -05:00
parent 535fb93df3
commit 3fa7d4225e
2 changed files with 7 additions and 7 deletions

View File

@ -35,13 +35,12 @@ method retract(ds: Dataspace; turn: var Turn; h: Handle) =
method message(ds: Dataspace; turn: var Turn; v: Assertion) = method message(ds: Dataspace; turn: var Turn; v: Assertion) =
ds.index.deliverMessage(turn, v) ds.index.deliverMessage(turn, v)
proc newDataspace*(turn: var Turn): Ref =
newRef(turn, Dataspace(index: initIndex()))
type BootProc = proc (ds: Ref; turn: var Turn) {.gcsafe.} type BootProc = proc (ds: Ref; turn: var Turn) {.gcsafe.}
proc bootDataspace*(name: string; bootProc: BootProc): Actor {.discardable.} = proc bootDataspace*(name: string; bootProc: BootProc): Actor {.discardable.} =
bootActor(name) do (turn: var Turn): bootActor(name) do (turn: var Turn):
discard turn.facet.preventInertCheck() discard turn.facet.preventInertCheck()
let ds = newRef(turn, Dataspace(index: initIndex())) bootProc(newDataspace(turn), turn)
bootProc(ds, turn)
proc newDataspace*(turn: var Turn): Ref =
newRef(turn, Dataspace(index: initIndex()))

View File

@ -1,12 +1,13 @@
# Package # Package
version = "20221013" version = "20221026"
author = "Emery Hemingway" author = "Emery Hemingway"
description = "Syndicated actors for conversational concurrency" description = "Syndicated actors for conversational concurrency"
license = "Unlicense" license = "Unlicense"
srcDir = "src" srcDir = "src"
bin = @["syndicate/unix/swaybar_status_actor"]
# Dependencies # Dependencies
requires "nim >= 1.4.8", "nimSHA2 >= 0.1.1", "preserves >= 20221013" requires "nim >= 1.4.8", "nimSHA2 >= 0.1.1", "preserves >= 202210222"