Next: Pubsub, Previous: Nonce Registry, Up: actor-lib: A standard library of sorts [Contents][Index]
The (goblins actor-lib opportunistic)
module provides
procedures to choose synchronous invocation if possible and fallback
to asynchronous invocation only if necessary.
If the actor to-refr is a near object, return $
;
otherwise, return <-
.
Invoke the actor to-refr with the arguments args using
$
if it is a near object and otherwise using <-
.
> (define a-vat (spawn-vat)) > (define b-vat (spawn-vat)) > (define a-chest (with-vat a-vat (spawn ^cell 'sword))) > (with-vat a-vat (run-$/<- a-chest)) => 'sword > (with-vat b-vat (run-$/<- a-chest)) => #<local-promise>