Use "do ():" for compatibility with Nim 2.0.0
This commit is contained in:
parent
a5c2d30ec4
commit
00269c04b1
|
@ -393,7 +393,7 @@ proc spawn*(name: string; turn: var Turn; bootProc: TurnAction; initialAssertion
|
|||
var newOutBound: Table[Handle, OutboundAssertion]
|
||||
for key in initialAssertions:
|
||||
discard turn.facet.outbound.pop(key, newOutbound[key])
|
||||
callSoon:
|
||||
callSoon do ():
|
||||
discard newActor(name, bootProc, newOutBound)
|
||||
|
||||
proc newInertRef*(): Ref =
|
||||
|
@ -413,7 +413,7 @@ proc terminate(actor; turn; reason: ref Exception) =
|
|||
actor.future.complete()
|
||||
else:
|
||||
actor.future.fail reason
|
||||
callSoon:
|
||||
callSoon do ():
|
||||
run(actor.root, finish, true)
|
||||
|
||||
proc terminate*(facet; e: ref Exception) =
|
||||
|
@ -423,7 +423,7 @@ proc terminate*(facet; e: ref Exception) =
|
|||
proc asyncCheck*(turn; fut: FutureBase) =
|
||||
## Sets a callback on `fut` which propagates exceptions to the facet of `turn`.
|
||||
let facet = turn.facet
|
||||
fut.addCallback do:
|
||||
fut.addCallback do ():
|
||||
if fut.failed: terminate(facet, fut.error)
|
||||
|
||||
template tryFacet(facet; body: untyped) =
|
||||
|
@ -433,7 +433,7 @@ template tryFacet(facet; body: untyped) =
|
|||
#except: terminate(facet, getCurrentException())
|
||||
|
||||
proc run(queues: Queues) =
|
||||
callSoon:
|
||||
callSoon do ():
|
||||
for facet, queue in queues:
|
||||
for action in queue: run(facet, action)
|
||||
|
||||
|
@ -459,7 +459,7 @@ proc addCallback*(fut: FutureBase; turn: var Turn; act: TurnAction) =
|
|||
if fut.finished:
|
||||
enqueue(turn, facet, act)
|
||||
else:
|
||||
fut.addCallback do:
|
||||
fut.addCallback do ():
|
||||
run(facet, act)
|
||||
|
||||
proc addCallback*[T](fut: Future[T]; turn: var Turn; cb: proc (t: var Turn; f: Future[T]) {.closure, gcsafe.}) =
|
||||
|
|
|
@ -31,7 +31,7 @@ proc connectNet*(turn: var Turn; remote: RemoteSpecifier; cap: SturdyRef; bootPr
|
|||
reenable = facet.preventInertCheck()
|
||||
connectionClosedRef = newRef(turn, ShutdownEntity())
|
||||
conn = connectTcp(remote)
|
||||
conn.onReady do:
|
||||
conn.onReady do ():
|
||||
discard bootActor("net") do (turn: var Turn):
|
||||
var shutdownRef: Ref
|
||||
proc tapsWriter(pkt: sink Packet): Future[void] =
|
||||
|
@ -53,7 +53,7 @@ proc connectNet*(turn: var Turn; remote: RemoteSpecifier; cap: SturdyRef; bootPr
|
|||
terminate(facet, reason)
|
||||
conn.onReceiveError do (ctx: MessageContext; reason: ref Exception):
|
||||
terminate(facet, reason)
|
||||
conn.onClosed do:
|
||||
conn.onClosed do ():
|
||||
run(facet) do (turn: var Turn):
|
||||
stopActor(turn)
|
||||
var wireBuf = newBufferedDecoder()
|
||||
|
|
|
@ -112,7 +112,7 @@ proc send(r: Relay; pkt: sink Packet): Future[void] =
|
|||
|
||||
proc send(r: Relay; rOid: protocol.Oid; m: Event) =
|
||||
if r.pendingTurn.len == 0:
|
||||
callSoon:
|
||||
callSoon do ():
|
||||
r.facet.run do (turn: var Turn):
|
||||
var pkt = Packet(
|
||||
orKind: PacketKind.Turn,
|
||||
|
|
Loading…
Reference in New Issue