NAME

Contize - Help an object be a continuation thingie (suspendable)

SYNOPSIS

Help an object be suspendable, like a continuation.

INTRODUCTION

Contize helps an object to be suspendable. The object must be aware of this, and when it is ready to be halted calls $self->suspend(@results), replacing the normal return statement.

METHODS

$thingie = new Contize($thingie)

Takes a $thingie object and continuizes it... we replace it with ourselves and intercept all method calls.

$thingie->nocache('methodname1', 'methodname2', ...)

Turn off caching for the given methods

$thingie->somemethod(@params) ... aka AUTOLOAD

AUTOLOAD actually does the work. We intercept method invocations and usually cache the results. Difficult to explain...

$thingie->suspend($retval)

This replaces the return function in a subroutine and suspends the object. When the object is resumed it will give $retval to the caller.

$thingie->reset()

Reset the thingie so that it will be re-run. This clears the callstack and the callstack_count so that it will begin returning cached results.

DESTROY

Upon destruction we undef our child, thus calling the child's own DESTROY, if such a thing exists. I'm pretty sure this is the proper way to do things, but it might break if their DESTROY does more complicated activities.

SEE ALSO

Coro::Cont

AUTHOR

Brock Wilcox <awwaiid@thelackthereof.org>

COPYRIGHT

Copyright (c) 2004 Brock Wilcox <awwaiid@thelackthereof.org>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.