Thread::Apartment::Closure

SUMMARY: CONSTR | METHOD | DETAIL: CONSTR | METHOD

## Class Thread::Apartment::Closure

Inherits from:
  Thread::Queue::Queueable

Provides a proxy to permit closures to be passed between, and invoked by, external apartment threads.

Implements Thread::Queue::Queueable to permit curse/redeem operations when passed between threads via TQDs.

Licensed under the Academic Free License version 2.1, as specified in the License.txt file included in this software package, or at OpenSource.org.

Author:
  D. Arnold
Version:
  0.50
Since:
  2005-12-01

Unless otherwise noted, `$self` is the object instance variable.

Constructor Summary
`new($sig, $id, $tac)` Stores the arguments into a blessed arrayref

Method Summary
`redeem($class, $obj)` Redeem the object after being passed to a thread

Constructor Details

### new

    new($sig, $id, $tac)

  Stores the arguments into a blessed arrayref.

  Parameters:
    `$sig` - unique apartment thread signature used to reject calls to stale closures after an apartment thread has been recycled
    `$id` - unique closure ID used to lookup the closure in the originating apartment thread's closure map
    `$tac` - Thread::Apartment::Client object for the originating apartment thread
  Returns:
    Thread::Apartment::Closure object

Method Details

### redeem

    redeem($class, $obj)

  Redeem the object after being passed to a thread. Causes the TACl contents to be converted to a closure that invokes a well known method on the originating thread.

  Parameters:
    `$class` - class to redeem to (unused)
    `$obj` - the object structure being redeemed
  Returns:
    closure to invoke proxied closure on the TACl's TAC

Generated by psichedoc on Mon Mar 27 08:51:36 2006