This stupid thing has to block

This commit is contained in:
Emery Hemingway 2023-05-05 18:16:24 +01:00
parent 55fdd4cc04
commit 76d4d77c24
2 changed files with 3 additions and 8 deletions

View File

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

View File

@ -34,12 +34,11 @@ proc relayEvents(ds: Ref; facet: Facet) =
info = resolveMulticastInfo(nls, "acpi_event\0")
close(nls)
let mcast = openSocket(int info.mcastGrpId)
proc relayEvent =
while true:
let event = recvAcpiEvent(mcast, info.familyId)
run(facet) do (turn: var Turn):
message(turn, ds, event)
callSoon: relayEvent()
callSoon: relayEvent()
poll()
# TODO seccomp
@ -49,10 +48,6 @@ type Args {.preservesDictionary.} = object
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()