Idiomatic syndicate

This commit is contained in:
Emery Hemingway 2023-05-03 20:45:49 +01:00
parent 8002390284
commit 55fdd4cc04
3 changed files with 12 additions and 4 deletions

View File

@ -1,6 +1,6 @@
# Package
version = "20230502"
version = "20230503"
author = "Emery Hemingway"
description = "Syndicate actor for publishing Linux ACPI events"
license = "Unlicense"

View File

@ -43,8 +43,16 @@ proc relayEvents(ds: Ref; facet: Facet) =
# TODO seccomp
bootDataspace("main") do (ds: Ref; turn: var Turn):
connectStdio(ds, turn)
relayEvents(ds, turn.facet)
type Args {.preservesDictionary.} = object
machine: Ref
bootDataspace("main") do (root: Ref; turn: var Turn):
connectStdio(root, turn)
onPublish(turn, root, ?Args) do (ds: Ref):
stderr.writeLine("ds is ", ds)
relayEvents(ds, turn.facet)
onPublish(turn, root, grab()) do (a: Assertion):
stderr.writeLine("saw ", a)
runForever()