Rename proc facet(…) to proc inFacet(…)

This commit is contained in:
Emery Hemingway 2023-03-26 13:03:22 -05:00
parent 6f2adf573a
commit 71955f257d
4 changed files with 7 additions and 6 deletions

View File

@ -38,7 +38,7 @@ export SturdyRef
export Actor, Assertion, Facet, Handle, Ref, Symbol, Turn, TurnAction, export Actor, Assertion, Facet, Handle, Ref, Symbol, Turn, TurnAction,
`$`, `?`, addCallback, analyse, asyncCheck, bootDataspace, `$`, `?`, addCallback, analyse, asyncCheck, bootDataspace,
drop, facet, future, grab, message, newDataspace, publish, drop, facet, future, grab, grabType, inFacet, message, newDataspace, publish,
retract, replace, run, stop, unembed retract, replace, run, stop, unembed
type type
@ -185,7 +185,6 @@ proc wrapDuringHandler(entryBody, exitBody: NimNode): NimNode =
turnSym = ident"turn" turnSym = ident"turn"
bindingsSym = ident"bindings" bindingsSym = ident"bindings"
handleSym = ident"duringHandle" handleSym = ident"duringHandle"
entrySym = genSym(nskProc, "during")
duringSym = genSym(nskProc, "during") duringSym = genSym(nskProc, "during")
if exitBody.isNil: if exitBody.isNil:
quote do: quote do:

View File

@ -367,10 +367,12 @@ proc stopIfInertAfter(action: TurnAction): TurnAction =
stop(turn) stop(turn)
wrapper wrapper
proc facet*(turn: var Turn; bootProc: TurnAction): Facet = proc inFacet*(turn: var Turn; bootProc: TurnAction): Facet =
result = newFacet(turn.facet.actor, some turn.facet) result = newFacet(turn.facet.actor, some turn.facet)
inFacet(turn, result, stopIfInertAfter(bootProc)) inFacet(turn, result, stopIfInertAfter(bootProc))
proc facet*(turn: var Turn; bootProc: TurnAction): Facet {.deprecated.} = inFacet(turn, bootProc)
proc newActor(name: string; bootProc: TurnAction; initialAssertions: OutboundTable): Actor = proc newActor(name: string; bootProc: TurnAction; initialAssertions: OutboundTable): Actor =
let let
now = getTime() now = getTime()

View File

@ -3,7 +3,7 @@
## Module for peering with remote dataspaces over network. ## Module for peering with remote dataspaces over network.
import std/[asyncdispatch, net, options, streams, tables] import std/[asyncdispatch, net, options, tables]
import preserves import preserves
import ./actors, ./durings, ./relays, ./protocols/protocol import ./actors, ./durings, ./relays, ./protocols/protocol
@ -71,7 +71,7 @@ proc connectNet*(turn: var Turn; remote: RemoteSpecifier; cap: SturdyRef; bootPr
reenable() reenable()
discard publish(turn, shutdownRef, true) discard publish(turn, shutdownRef, true)
proc duringCallback(turn: var Turn; a: Assertion; h: Handle): TurnAction = proc duringCallback(turn: var Turn; a: Assertion; h: Handle): TurnAction =
let facet = facet(turn) do (turn: var Turn): let facet = inFacet(turn) do (turn: var Turn):
bootProc(turn, unembed a) bootProc(turn, unembed a)
proc action(turn: var Turn) = proc action(turn: var Turn) =
stop(turn, facet) stop(turn, facet)

View File

@ -340,7 +340,7 @@ when defined(posix):
reenable() reenable()
discard publish(turn, shutdownRef, true) discard publish(turn, shutdownRef, true)
proc duringCallback(turn: var Turn; a: Assertion; h: Handle): TurnAction = proc duringCallback(turn: var Turn; a: Assertion; h: Handle): TurnAction =
let facet = facet(turn) do (turn: var Turn): let facet = inFacet(turn) do (turn: var Turn):
bootProc(turn, unembed a) bootProc(turn, unembed a)
proc action(turn: var Turn) = proc action(turn: var Turn) =
stop(turn, facet) stop(turn, facet)