Previous: , Up: actor-lib: A standard library of sorts   [Contents][Index]


6.18 Ward

The (goblins actor-lib ward) module provides a mechanism for an actor to restrict access to its behaviors using the conceptual metaphor of a magical ward. It is inspired by parts of the E ecosystem.

Procedure: spawn-warding-pair [#:async? #f] [#:sealer-triplet #f]

Return values holding a warden and an incanter. If async? is #t, the incanter will use <- to invoke sealed actors; otherwise, it will use $. If provided, sealer-triplet is the set of sealers to use instead of creating a new set.

The warden is not meant to be used directly; see ward below.

The incanter can be invoked with a target actor and the args to invoke it with.

Procedure: ward warden behavior [#:extends #f] [#:async? #f]

Return behavior sealed by warden so that only its associated incanter can use the behavior. extends, if provided, is an actor to extend with the warded behavior. If async? is #t, invoke behavior using <-; otherwise us $.

The returned behavior can be invoked with either a singe list of sealed arguments or any number of unsealed arguments.

Procedure: enchant incanter target [#:async? #f]

Spawn and return a reference to a proxy which invokes target using incanter to access its warded behavior. If async? is #t, invoke target using <-; otherwise, use $.

Procedure: warden->ward-proc warden

Return a procedure to wrap ward using warden. The returned procedure accepts two arguments: warded-beh, which is the behavior to ward; and extends-beh, which is the actor to extend with that behavior.

Persistence Environment: ward-env

Previous: Ticker, Up: actor-lib: A standard library of sorts   [Contents][Index]