relays: resolve environment once
This commit is contained in:
parent
50b00827ce
commit
76acf2cb67
|
@ -561,11 +561,16 @@ proc resolve*(turn: var Turn; ds: Cap; route: Route; bootProc: BootProc) =
|
||||||
proc resolveEnvironment*(turn: var Turn; bootProc: BootProc) =
|
proc resolveEnvironment*(turn: var Turn; bootProc: BootProc) =
|
||||||
## Resolve a capability from the calling environment
|
## Resolve a capability from the calling environment
|
||||||
## and call `bootProc`. See envRoute_.
|
## and call `bootProc`. See envRoute_.
|
||||||
|
var resolved = false
|
||||||
let
|
let
|
||||||
ds = newDataspace(turn)
|
ds = newDataspace(turn)
|
||||||
pat = ResolvePath ?: {0: ?envRoute(), 3: ?:ResolvedAccepted}
|
pat = ResolvePath ?: {0: ?envRoute(), 3: ?:ResolvedAccepted}
|
||||||
during(turn, ds, pat) do (dst: Cap):
|
during(turn, ds, pat) do (dst: Cap):
|
||||||
bootProc(turn, dst)
|
if not resolved:
|
||||||
|
resolved = true
|
||||||
|
bootProc(turn, dst)
|
||||||
|
do:
|
||||||
|
resolved = false
|
||||||
spawnRelays(turn, ds)
|
spawnRelays(turn, ds)
|
||||||
|
|
||||||
# TODO: define a runActor that comes preloaded with relaying
|
# TODO: define a runActor that comes preloaded with relaying
|
||||||
|
|
Loading…
Reference in New Issue