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


6.3 Facet

The (goblins actor-lib facet) module provides an actor to wrap another object and only allow certain methods through. It also provides a convenience function for constructing such actors.

Constructor: ^facet bcom wrap-me [methods …]

Construct a proxy of the actor wrap-me with access to only methods, a list of symbols corresponding to methods of wrap-me. The wrap-me will be invoked with $ if possible, and otherwise will be invoked with <-. For cases where synchronicity is possible but not desired, invoking the facet asynchronously has the same effect as invoking wrap-me asynchronously.

Procedure: facet wrap-me [methods …]

Spawn and return a reference to a ^facet, passing along arguments to their equivalents in the constructor.