relays: add resolve proc
This commit is contained in:
parent
6fcb76b1e9
commit
3a04fc195b
|
@ -416,3 +416,18 @@ when defined(posix):
|
|||
dispatch(relay, pr)
|
||||
asyncStdin.read(stdinReadSize).addCallback(readCb)
|
||||
asyncStdin.read(stdinReadSize).addCallback(readCb)
|
||||
|
||||
type BootProc* = proc (turn: var Turn; ds: Cap) {.gcsafe.}
|
||||
|
||||
proc resolve*(turn: var Turn; route: Route; bootProc: BootProc) =
|
||||
var
|
||||
unix: Unix
|
||||
tcp: Tcp
|
||||
if route.transports.len != 1 or route.pathSteps.len != 1:
|
||||
raise newException(ValueError, "only a single transport and step supported for routes")
|
||||
if unix.fromPreserve route.transports[0]:
|
||||
connect(turn, unix, route.pathSteps[0], bootProc)
|
||||
elif tcp.fromPreserve route.transports[0]:
|
||||
connect(turn, tcp, route.pathSteps[0], bootProc)
|
||||
else:
|
||||
raise newException(ValueError, "unsupported route")
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Package
|
||||
|
||||
version = "20231005"
|
||||
version = "20231013"
|
||||
author = "Emery Hemingway"
|
||||
description = "Syndicated actors for conversational concurrency"
|
||||
license = "Unlicense"
|
||||
|
|
Loading…
Reference in New Issue