SUMMARY: CONSTR | METHOD | DETAIL: CONSTR | METHOD |
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.
Unless otherwise noted, $obj
is the object instance variable.
Method Summary |
---|
curse()
Marshal an object into a value that can be passed via a Thread::Queue::Duplex object |
onCancel()
Pure virtual function to apply any object-specific cancel processing |
onDequeue($object)
Unmarshall an object after being dequeued |
onEnqueue()
Marshal an object for queueing to a redeem($object) Unmarshall an object back into its blessed form |
Method Details |
---|
curse()
Called by TQD's various enqueue() and respond() methods when the TQQ object is being enqueue'd. Should return an unblessed, shared version of the input object.
Default returns a shared arrayref or hashref, depending on the object's base structure, with copies of all scalar members.
Note that objects with more complex members will need to
implement an object specific curse()
to do any deepcopying,
including curse()ing any subordinate objects.
onCancel()
onDequeue($object)
The default implementation redeem()'s the input object to copy the input shared arrayref or hashref into a nonshared equivalent, then blessing it into the specified class, returning the redeemed object.
$object
- the marshalled representation of the object
onEnqueue()
redeem($object)
Called by TQD's various dequeue() and wait methods to "redeem" (i.e., rebless) the object into its original class.
Default creates non-shared copy of the input object structure, copying its scalar contents, and blessing it into the specified class.
Note that objects with complex members need to implement
an object specific redeem()
, possibly recursively
redeem()ing subordinate objects (be careful
of circular references!)
$object
- marshalled aka "cursed" version of the object