Remove gcsafe declarations
CPS doesn't give gcsafe assurances.
This commit is contained in:
parent
3e5d910d1a
commit
d365a1e6e5
|
@ -34,21 +34,21 @@ proc `??`*(pat: Pattern; bindings: openArray[(int, Pattern)]): Pattern {.inline.
|
||||||
patterns.inject(pat, bindings)
|
patterns.inject(pat, bindings)
|
||||||
|
|
||||||
type
|
type
|
||||||
PublishProc = proc (turn: var Turn; v: Value; h: Handle) {.closure, gcsafe.}
|
PublishProc = proc (turn: var Turn; v: Value; h: Handle) {.closure.}
|
||||||
RetractProc = proc (turn: var Turn; h: Handle) {.closure, gcsafe.}
|
RetractProc = proc (turn: var Turn; h: Handle) {.closure.}
|
||||||
MessageProc = proc (turn: var Turn; v: Value) {.closure, gcsafe.}
|
MessageProc = proc (turn: var Turn; v: Value) {.closure.}
|
||||||
ClosureEntity = ref object of Entity
|
ClosureEntity = ref object of Entity
|
||||||
publishImpl: PublishProc
|
publishImpl: PublishProc
|
||||||
retractImpl: RetractProc
|
retractImpl: RetractProc
|
||||||
messageImpl: MessageProc
|
messageImpl: MessageProc
|
||||||
|
|
||||||
method publish(e: ClosureEntity; turn: var Turn; a: AssertionRef; h: Handle) {.gcsafe.} =
|
method publish(e: ClosureEntity; turn: var Turn; a: AssertionRef; h: Handle) =
|
||||||
if not e.publishImpl.isNil: e.publishImpl(turn, a.value, h)
|
if not e.publishImpl.isNil: e.publishImpl(turn, a.value, h)
|
||||||
|
|
||||||
method retract(e: ClosureEntity; turn: var Turn; h: Handle) {.gcsafe.} =
|
method retract(e: ClosureEntity; turn: var Turn; h: Handle) =
|
||||||
if not e.retractImpl.isNil: e.retractImpl(turn, h)
|
if not e.retractImpl.isNil: e.retractImpl(turn, h)
|
||||||
|
|
||||||
method message(e: ClosureEntity; turn: var Turn; a: AssertionRef) {.gcsafe.} =
|
method message(e: ClosureEntity; turn: var Turn; a: AssertionRef) =
|
||||||
if not e.messageImpl.isNil: e.messageImpl(turn, a.value)
|
if not e.messageImpl.isNil: e.messageImpl(turn, a.value)
|
||||||
|
|
||||||
proc argumentCount(handler: NimNode): int =
|
proc argumentCount(handler: NimNode): int =
|
||||||
|
@ -187,8 +187,8 @@ macro during*(turn: untyped; ds: Cap; pattern: Pattern; publishBody: untyped) =
|
||||||
`callbackProc`
|
`callbackProc`
|
||||||
discard observe(`turn`, `ds`, `pattern`, during(`callbackSym`))
|
discard observe(`turn`, `ds`, `pattern`, during(`callbackSym`))
|
||||||
|
|
||||||
type BootProc = proc (turn: var Turn; ds: Cap) {.gcsafe.}
|
type BootProc = proc (turn: var Turn; ds: Cap) {.closure.}
|
||||||
type DeprecatedBootProc = proc (ds: Cap; turn: var Turn) {.gcsafe.}
|
type DeprecatedBootProc = proc (ds: Cap; turn: var Turn) {.closure.}
|
||||||
|
|
||||||
proc runActor*(name: string; bootProc: BootProc) =
|
proc runActor*(name: string; bootProc: BootProc) =
|
||||||
## Run an `Actor` to completion.
|
## Run an `Actor` to completion.
|
||||||
|
|
|
@ -66,7 +66,7 @@ type
|
||||||
turnIdAllocator: ref TurnId
|
turnIdAllocator: ref TurnId
|
||||||
traceStream: FileStream
|
traceStream: FileStream
|
||||||
|
|
||||||
TurnAction* = proc (t: var Turn) {.gcsafe.}
|
TurnAction* = proc (t: var Turn) {.closure.}
|
||||||
|
|
||||||
Queues = TableRef[Facet, seq[TurnAction]]
|
Queues = TableRef[Facet, seq[TurnAction]]
|
||||||
|
|
||||||
|
@ -108,10 +108,10 @@ when tracing:
|
||||||
result.add f.id.toPreserves
|
result.add f.id.toPreserves
|
||||||
f = f.parent
|
f = f.parent
|
||||||
|
|
||||||
method publish*(e: Entity; turn: var Turn; v: AssertionRef; h: Handle) {.base, gcsafe.} = discard
|
method publish*(e: Entity; turn: var Turn; v: AssertionRef; h: Handle) {.base.} = discard
|
||||||
method retract*(e: Entity; turn: var Turn; h: Handle) {.base, gcsafe.} = discard
|
method retract*(e: Entity; turn: var Turn; h: Handle) {.base.} = discard
|
||||||
method message*(e: Entity; turn: var Turn; v: AssertionRef) {.base, gcsafe.} = discard
|
method message*(e: Entity; turn: var Turn; v: AssertionRef) {.base.} = discard
|
||||||
method sync*(e: Entity; turn: var Turn; peer: Cap) {.base, gcsafe.} = discard
|
method sync*(e: Entity; turn: var Turn; peer: Cap) {.base.} = discard
|
||||||
|
|
||||||
using
|
using
|
||||||
actor: Actor
|
actor: Actor
|
||||||
|
@ -341,9 +341,9 @@ proc replace*[T](turn: var Turn; cap: Cap; h: var Handle; v: T): Handle {.discar
|
||||||
retract(turn, old)
|
retract(turn, old)
|
||||||
h
|
h
|
||||||
|
|
||||||
proc stop*(turn: var Turn) {.gcsafe.}
|
proc stop*(turn: var Turn)
|
||||||
|
|
||||||
proc run*(facet; action: TurnAction; zombieTurn = false) {.gcsafe.}
|
proc run*(facet; action: TurnAction; zombieTurn = false)
|
||||||
|
|
||||||
proc newFacet(actor; parent: Facet; initialAssertions: OutboundTable): Facet =
|
proc newFacet(actor; parent: Facet; initialAssertions: OutboundTable): Facet =
|
||||||
result = Facet(
|
result = Facet(
|
||||||
|
@ -363,7 +363,7 @@ proc isInert(facet): bool =
|
||||||
(facet.outbound.len == 0 or facet.parent.isNil) and
|
(facet.outbound.len == 0 or facet.parent.isNil) and
|
||||||
facet.inertCheckPreventers == 0
|
facet.inertCheckPreventers == 0
|
||||||
|
|
||||||
proc preventInertCheck*(facet): (proc() {.gcsafe.}) {.discardable.} =
|
proc preventInertCheck*(facet): (proc()) {.discardable.} =
|
||||||
var armed = true
|
var armed = true
|
||||||
inc facet.inertCheckPreventers
|
inc facet.inertCheckPreventers
|
||||||
proc disarm() =
|
proc disarm() =
|
||||||
|
@ -378,9 +378,9 @@ proc inFacet(turn: var Turn; facet; act: TurnAction) =
|
||||||
var t = Turn(facet: facet, queues: turn.queues)
|
var t = Turn(facet: facet, queues: turn.queues)
|
||||||
act(t)
|
act(t)
|
||||||
|
|
||||||
proc terminate(actor; turn; reason: ref Exception) {.gcsafe.}
|
proc terminate(actor; turn; reason: ref Exception)
|
||||||
|
|
||||||
proc terminate(facet; turn: var Turn; orderly: bool) {.gcsafe.} =
|
proc terminate(facet; turn: var Turn; orderly: bool) =
|
||||||
if facet.isAlive:
|
if facet.isAlive:
|
||||||
facet.isAlive = false
|
facet.isAlive = false
|
||||||
let parent = facet.parent
|
let parent = facet.parent
|
||||||
|
@ -555,7 +555,7 @@ proc addCallback*(fut: FutureBase; turn: var Turn; act: TurnAction) =
|
||||||
else:
|
else:
|
||||||
addCallback(fut, turn.facet, act)
|
addCallback(fut, turn.facet, act)
|
||||||
|
|
||||||
proc addCallback*[T](fut: Future[T]; turn: var Turn; act: proc (t: var Turn, x: T) {.gcsafe.}) =
|
proc addCallback*[T](fut: Future[T]; turn: var Turn; act: proc (t: var Turn, x: T) {.closure.}) =
|
||||||
addCallback(fut, turn) do (turn: var Turn):
|
addCallback(fut, turn) do (turn: var Turn):
|
||||||
if fut.failed: terminate(turn.facet, fut.error)
|
if fut.failed: terminate(turn.facet, fut.error)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -51,7 +51,7 @@ iterator observersOf[Sid, Oid](g: Graph[Sid, Oid]; oid: Oid): Sid =
|
||||||
if g.edgesForward.hasKey(oid):
|
if g.edgesForward.hasKey(oid):
|
||||||
for sid in g.edgesForward[oid]: yield sid
|
for sid in g.edgesForward[oid]: yield sid
|
||||||
|
|
||||||
proc repairDamage*[Sid, Oid](g: var Graph[Sid, Oid]; repairNode: proc (sid: Sid) {.gcsafe.}) =
|
proc repairDamage*[Sid, Oid](g: var Graph[Sid, Oid]; repairNode: proc (sid: Sid) {.closure.}) =
|
||||||
var repairedThisRound: Set[Oid]
|
var repairedThisRound: Set[Oid]
|
||||||
while true:
|
while true:
|
||||||
var workSet = move g.damagedNodes
|
var workSet = move g.damagedNodes
|
||||||
|
|
|
@ -16,14 +16,14 @@ type
|
||||||
index: Index
|
index: Index
|
||||||
handleMap: Table[Handle, Assertion]
|
handleMap: Table[Handle, Assertion]
|
||||||
|
|
||||||
method publish(ds: Dataspace; turn: var Turn; a: AssertionRef; h: Handle) {.gcsafe.} =
|
method publish(ds: Dataspace; turn: var Turn; a: AssertionRef; h: Handle) =
|
||||||
if add(ds.index, turn, a.value):
|
if add(ds.index, turn, a.value):
|
||||||
var obs = a.value.preservesTo(Observe)
|
var obs = a.value.preservesTo(Observe)
|
||||||
if obs.isSome and obs.get.observer of Cap:
|
if obs.isSome and obs.get.observer of Cap:
|
||||||
ds.index.add(turn, obs.get.pattern, Cap(obs.get.observer))
|
ds.index.add(turn, obs.get.pattern, Cap(obs.get.observer))
|
||||||
ds.handleMap[h] = a.value
|
ds.handleMap[h] = a.value
|
||||||
|
|
||||||
method retract(ds: Dataspace; turn: var Turn; h: Handle) {.gcsafe.} =
|
method retract(ds: Dataspace; turn: var Turn; h: Handle) =
|
||||||
let v = ds.handleMap[h]
|
let v = ds.handleMap[h]
|
||||||
if remove(ds.index, turn, v):
|
if remove(ds.index, turn, v):
|
||||||
ds.handleMap.del h
|
ds.handleMap.del h
|
||||||
|
@ -31,14 +31,14 @@ method retract(ds: Dataspace; turn: var Turn; h: Handle) {.gcsafe.} =
|
||||||
if obs.isSome and obs.get.observer of Cap:
|
if obs.isSome and obs.get.observer of Cap:
|
||||||
ds.index.remove(turn, obs.get.pattern, Cap(obs.get.observer))
|
ds.index.remove(turn, obs.get.pattern, Cap(obs.get.observer))
|
||||||
|
|
||||||
method message(ds: Dataspace; turn: var Turn; a: AssertionRef) {.gcsafe.} =
|
method message(ds: Dataspace; turn: var Turn; a: AssertionRef) =
|
||||||
ds.index.deliverMessage(turn, a.value)
|
ds.index.deliverMessage(turn, a.value)
|
||||||
|
|
||||||
proc newDataspace*(turn: var Turn): Cap =
|
proc newDataspace*(turn: var Turn): Cap =
|
||||||
newCap(turn, Dataspace(index: initIndex()))
|
newCap(turn, Dataspace(index: initIndex()))
|
||||||
|
|
||||||
type BootProc = proc (turn: var Turn; ds: Cap) {.gcsafe.}
|
type BootProc = proc (turn: var Turn; ds: Cap) {.closure.}
|
||||||
type DeprecatedBootProc = proc (ds: Cap; turn: var Turn) {.gcsafe.}
|
type DeprecatedBootProc = proc (ds: Cap; turn: var Turn) {.closure.}
|
||||||
|
|
||||||
proc bootDataspace*(name: string; bootProc: BootProc): Actor =
|
proc bootDataspace*(name: string; bootProc: BootProc): Actor =
|
||||||
bootActor(name) do (turn: var Turn):
|
bootActor(name) do (turn: var Turn):
|
||||||
|
|
|
@ -6,7 +6,7 @@ import preserves
|
||||||
import ./actors, ./patterns, ./protocols/dataspace
|
import ./actors, ./patterns, ./protocols/dataspace
|
||||||
|
|
||||||
type
|
type
|
||||||
DuringProc* = proc (turn: var Turn; a: Value; h: Handle): TurnAction {.gcsafe.}
|
DuringProc* = proc (turn: var Turn; a: Value; h: Handle): TurnAction
|
||||||
DuringActionKind = enum null, dead, act
|
DuringActionKind = enum null, dead, act
|
||||||
DuringAction = object
|
DuringAction = object
|
||||||
case kind: DuringActionKind
|
case kind: DuringActionKind
|
||||||
|
|
|
@ -313,7 +313,7 @@ proc grabDictionary*(bindings: sink openArray[(string, Pattern)]): Pattern =
|
||||||
for (key, val) in bindings.items:
|
for (key, val) in bindings.items:
|
||||||
result.dcompound.dict.entries[key.toSymbol] = val
|
result.dcompound.dict.entries[key.toSymbol] = val
|
||||||
|
|
||||||
proc depattern(comp: DCompound; values: var seq[Value]; index: var int): Value {.gcsafe.}
|
proc depattern(comp: DCompound; values: var seq[Value]; index: var int): Value
|
||||||
|
|
||||||
proc depattern(pat: Pattern; values: var seq[Value]; index: var int): Value =
|
proc depattern(pat: Pattern; values: var seq[Value]; index: var int): Value =
|
||||||
case pat.orKind
|
case pat.orKind
|
||||||
|
@ -328,7 +328,7 @@ proc depattern(pat: Pattern; values: var seq[Value]; index: var int): Value =
|
||||||
of PatternKind.DCompound:
|
of PatternKind.DCompound:
|
||||||
result = depattern(pat.dcompound, values, index)
|
result = depattern(pat.dcompound, values, index)
|
||||||
|
|
||||||
proc depattern(comp: DCompound; values: var seq[Value]; index: var int): Value {.gcsafe.} =
|
proc depattern(comp: DCompound; values: var seq[Value]; index: var int): Value =
|
||||||
case comp.orKind
|
case comp.orKind
|
||||||
of DCompoundKind.rec:
|
of DCompoundKind.rec:
|
||||||
result = initRecord(comp.rec.label, comp.rec.fields.len)
|
result = initRecord(comp.rec.label, comp.rec.fields.len)
|
||||||
|
|
|
@ -27,8 +27,8 @@ type
|
||||||
Turn = syndicate.Turn
|
Turn = syndicate.Turn
|
||||||
Handle = actors.Handle
|
Handle = actors.Handle
|
||||||
|
|
||||||
PacketWriter = proc (turn: var Turn; buf: seq[byte]) {.closure, gcsafe.}
|
PacketWriter = proc (turn: var Turn; buf: seq[byte]) {.closure.}
|
||||||
RelaySetup = proc (turn: var Turn; relay: Relay) {.closure, gcsafe.}
|
RelaySetup = proc (turn: var Turn; relay: Relay) {.closure.}
|
||||||
|
|
||||||
Relay* = ref object
|
Relay* = ref object
|
||||||
facet: Facet
|
facet: Facet
|
||||||
|
@ -90,7 +90,7 @@ proc rewriteCapOut(relay: Relay; cap: Cap; exported: var seq[WireSymbol]): WireR
|
||||||
mine: WireRefMine(oid: ws.oid))
|
mine: WireRefMine(oid: ws.oid))
|
||||||
|
|
||||||
proc rewriteOut(relay: Relay; v: Assertion):
|
proc rewriteOut(relay: Relay; v: Assertion):
|
||||||
tuple[rewritten: Value, exported: seq[WireSymbol]] {.gcsafe.} =
|
tuple[rewritten: Value, exported: seq[WireSymbol]] {.closure.} =
|
||||||
var exported: seq[WireSymbol]
|
var exported: seq[WireSymbol]
|
||||||
result.rewritten = mapEmbeds(v) do (pr: Value) -> Value:
|
result.rewritten = mapEmbeds(v) do (pr: Value) -> Value:
|
||||||
let o = pr.unembed(Cap); if o.isSome:
|
let o = pr.unembed(Cap); if o.isSome:
|
||||||
|
@ -123,26 +123,26 @@ proc send(relay: Relay; turn: var Turn; rOid: protocol.Oid; m: Event) =
|
||||||
proc send(re: RelayEntity; turn: var Turn; ev: Event) =
|
proc send(re: RelayEntity; turn: var Turn; ev: Event) =
|
||||||
send(re.relay, turn, protocol.Oid re.oid, ev)
|
send(re.relay, turn, protocol.Oid re.oid, ev)
|
||||||
|
|
||||||
method publish(re: RelayEntity; t: var Turn; a: AssertionRef; h: Handle) {.gcsafe.} =
|
method publish(re: RelayEntity; t: var Turn; a: AssertionRef; h: Handle) =
|
||||||
re.send(t, Event(
|
re.send(t, Event(
|
||||||
orKind: EventKind.Assert,
|
orKind: EventKind.Assert,
|
||||||
`assert`: protocol.Assert(
|
`assert`: protocol.Assert(
|
||||||
assertion: re.relay.register(a.value, h).rewritten,
|
assertion: re.relay.register(a.value, h).rewritten,
|
||||||
handle: h)))
|
handle: h)))
|
||||||
|
|
||||||
method retract(re: RelayEntity; t: var Turn; h: Handle) {.gcsafe.} =
|
method retract(re: RelayEntity; t: var Turn; h: Handle) =
|
||||||
re.relay.deregister h
|
re.relay.deregister h
|
||||||
re.send(t, Event(
|
re.send(t, Event(
|
||||||
orKind: EventKind.Retract,
|
orKind: EventKind.Retract,
|
||||||
retract: Retract(handle: h)))
|
retract: Retract(handle: h)))
|
||||||
|
|
||||||
method message(re: RelayEntity; turn: var Turn; msg: AssertionRef) {.gcsafe.} =
|
method message(re: RelayEntity; turn: var Turn; msg: AssertionRef) =
|
||||||
var (value, exported) = rewriteOut(re.relay, msg.value)
|
var (value, exported) = rewriteOut(re.relay, msg.value)
|
||||||
assert(len(exported) == 0, "cannot send a reference in a message")
|
assert(len(exported) == 0, "cannot send a reference in a message")
|
||||||
if len(exported) == 0:
|
if len(exported) == 0:
|
||||||
re.send(turn, Event(orKind: EventKind.Message, message: Message(body: value)))
|
re.send(turn, Event(orKind: EventKind.Message, message: Message(body: value)))
|
||||||
|
|
||||||
method sync(re: RelayEntity; turn: var Turn; peer: Cap) {.gcsafe.} =
|
method sync(re: RelayEntity; turn: var Turn; peer: Cap) =
|
||||||
var
|
var
|
||||||
peerEntity = newSyncPeerEntity(re.relay, peer)
|
peerEntity = newSyncPeerEntity(re.relay, peer)
|
||||||
exported: seq[WireSymbol]
|
exported: seq[WireSymbol]
|
||||||
|
@ -185,7 +185,7 @@ proc rewriteCapIn(relay; facet; n: WireRef, imported: var seq[WireSymbol]): Cap
|
||||||
else: raiseAssert "attenuation not implemented"
|
else: raiseAssert "attenuation not implemented"
|
||||||
|
|
||||||
proc rewriteIn(relay; facet; v: Value):
|
proc rewriteIn(relay; facet; v: Value):
|
||||||
tuple[rewritten: Assertion; imported: seq[WireSymbol]] {.gcsafe.} =
|
tuple[rewritten: Assertion; imported: seq[WireSymbol]] =
|
||||||
var imported: seq[WireSymbol]
|
var imported: seq[WireSymbol]
|
||||||
result.rewritten = mapEmbeds(v) do (pr: Value) -> Value:
|
result.rewritten = mapEmbeds(v) do (pr: Value) -> Value:
|
||||||
let wr = pr.preservesTo WireRef; if wr.isSome:
|
let wr = pr.preservesTo WireRef; if wr.isSome:
|
||||||
|
@ -196,7 +196,7 @@ proc rewriteIn(relay; facet; v: Value):
|
||||||
|
|
||||||
proc close(r: Relay) = discard
|
proc close(r: Relay) = discard
|
||||||
|
|
||||||
proc dispatch(relay: Relay; turn: var Turn; cap: Cap; event: Event) {.gcsafe.} =
|
proc dispatch(relay: Relay; turn: var Turn; cap: Cap; event: Event) =
|
||||||
case event.orKind
|
case event.orKind
|
||||||
of EventKind.Assert:
|
of EventKind.Assert:
|
||||||
let (a, imported) = rewriteIn(relay, turn.facet, event.assert.assertion)
|
let (a, imported) = rewriteIn(relay, turn.facet, event.assert.assertion)
|
||||||
|
@ -224,7 +224,7 @@ proc dispatch(relay: Relay; turn: var Turn; cap: Cap; event: Event) {.gcsafe.} =
|
||||||
for e in imported: relay.imported.del e
|
for e in imported: relay.imported.del e
|
||||||
]#
|
]#
|
||||||
|
|
||||||
proc dispatch(relay: Relay; v: Value) {.gcsafe.} =
|
proc dispatch(relay: Relay; v: Value) =
|
||||||
trace "S: ", v
|
trace "S: ", v
|
||||||
run(relay.facet) do (t: var Turn):
|
run(relay.facet) do (t: var Turn):
|
||||||
var pkt: Packet
|
var pkt: Packet
|
||||||
|
@ -334,7 +334,7 @@ when defined(posix):
|
||||||
resolved: relay.peer.accepted,
|
resolved: relay.peer.accepted,
|
||||||
))
|
))
|
||||||
const stdinReadSize = 0x2000
|
const stdinReadSize = 0x2000
|
||||||
proc readCb(pktFut: Future[string]) {.gcsafe.} =
|
proc readCb(pktFut: Future[string]) =
|
||||||
if not pktFut.failed:
|
if not pktFut.failed:
|
||||||
var buf = pktFut.read
|
var buf = pktFut.read
|
||||||
if buf.len == 0:
|
if buf.len == 0:
|
||||||
|
@ -378,7 +378,7 @@ when defined(posix):
|
||||||
resolved: relay.peer.accepted,
|
resolved: relay.peer.accepted,
|
||||||
))
|
))
|
||||||
const recvSize = 0x4000
|
const recvSize = 0x4000
|
||||||
proc recvCb(pktFut: Future[string]) {.gcsafe.} =
|
proc recvCb(pktFut: Future[string]) =
|
||||||
if pktFut.failed or pktFut.read.len == 0:
|
if pktFut.failed or pktFut.read.len == 0:
|
||||||
run(facet) do (turn: var Turn): stopActor(turn)
|
run(facet) do (turn: var Turn): stopActor(turn)
|
||||||
else:
|
else:
|
||||||
|
@ -421,7 +421,7 @@ when defined(posix):
|
||||||
buffered = false)
|
buffered = false)
|
||||||
connect(turn, ds, ta.toPreserves, socket, connectUnix(socket, ta.path))
|
connect(turn, ds, ta.toPreserves, socket, connectUnix(socket, ta.path))
|
||||||
|
|
||||||
proc walk(turn: var Turn; ds, origin: Cap; route: Route; transOff, stepOff: int) {.gcsafe.} =
|
proc walk(turn: var Turn; ds, origin: Cap; route: Route; transOff, stepOff: int) =
|
||||||
if stepOff < route.pathSteps.len:
|
if stepOff < route.pathSteps.len:
|
||||||
let
|
let
|
||||||
step = route.pathSteps[stepOff]
|
step = route.pathSteps[stepOff]
|
||||||
|
@ -462,7 +462,7 @@ proc connectRoute(turn: var Turn; ds: Cap; route: Route; transOff: int) =
|
||||||
onPublish(turn, ds, acceptPat) do (origin: Cap):
|
onPublish(turn, ds, acceptPat) do (origin: Cap):
|
||||||
walk(turn, ds, origin, route, transOff, 0)
|
walk(turn, ds, origin, route, transOff, 0)
|
||||||
|
|
||||||
type StepCallback = proc (turn: var Turn; step: Value; origin, next: Cap) {.gcsafe.}
|
type StepCallback = proc (turn: var Turn; step: Value; origin, next: Cap) {.closure.}
|
||||||
|
|
||||||
proc spawnStepResolver(turn: var Turn; ds: Cap; stepType: Value; cb: StepCallback) =
|
proc spawnStepResolver(turn: var Turn; ds: Cap; stepType: Value; cb: StepCallback) =
|
||||||
spawn($stepType & "-step", turn) do (turn: var Turn):
|
spawn($stepType & "-step", turn) do (turn: var Turn):
|
||||||
|
@ -515,7 +515,7 @@ proc spawnRelays*(turn: var Turn; ds: Cap) =
|
||||||
publish(turn, ds, ResolvedPathStep(
|
publish(turn, ds, ResolvedPathStep(
|
||||||
origin: origin, pathStep: step, resolved: next.accepted))
|
origin: origin, pathStep: step, resolved: next.accepted))
|
||||||
|
|
||||||
type BootProc* = proc (turn: var Turn; ds: Cap) {.gcsafe.}
|
type BootProc* = proc (turn: var Turn; ds: Cap) {.closure.}
|
||||||
|
|
||||||
proc envRoute*: Route =
|
proc envRoute*: Route =
|
||||||
var text = getEnv("SYNDICATE_ROUTE")
|
var text = getEnv("SYNDICATE_ROUTE")
|
||||||
|
|
|
@ -65,9 +65,9 @@ func isEmpty(cont: Continuation): bool =
|
||||||
cont.cache.len == 0 and cont.leafMap.len == 0
|
cont.cache.len == 0 and cont.leafMap.len == 0
|
||||||
|
|
||||||
type
|
type
|
||||||
ContinuationProc = proc (c: Continuation; v: Value) {.gcsafe.}
|
ContinuationProc = proc (c: Continuation; v: Value) {.closure.}
|
||||||
LeafProc = proc (l: Leaf; v: Value) {.gcsafe.}
|
LeafProc = proc (l: Leaf; v: Value) {.closure.}
|
||||||
ObserverProc = proc (turn: var Turn; group: ObserverGroup; vs: seq[Value]) {.gcsafe.}
|
ObserverProc = proc (turn: var Turn; group: ObserverGroup; vs: seq[Value]) {.closure.}
|
||||||
|
|
||||||
proc getLeaves(cont: Continuation; constPaths: Paths): LeafMap =
|
proc getLeaves(cont: Continuation; constPaths: Paths): LeafMap =
|
||||||
result = cont.leafMap.getOrDefault(constPaths)
|
result = cont.leafMap.getOrDefault(constPaths)
|
||||||
|
|
Loading…
Reference in New Issue