Coder Social home page Coder Social logo

contize's Introduction

Contize version 0.2
====================

Fake Continuations for a Perl Object. Sort of.

Contize is primarily meant to be useful in the context of CGI programming. It
effectively alters the programmer's view of what is happening -- changing it
from a program which is run and re-run with each input/output into a program
which is continuously run, sending output and then pausing for input at certain
intervals. Documentation on using Contize for this style of CGI programming can
be found elsewhere for now.

Contize helps an object to be suspendable and resumeable. For this to happen
the object must be Contized, which is a lot like being blessed or Memoized.
Once an object has been Contized several new methods are provided to it. The
two most important methods are suspend and resume.

The suspend method logically replaces the normal return statement. So instead
of a method returning its results directly it instead does
"$self->suspend(@results)". The suspend method contains an 'exit', so upon
suspend the entire process is terminated. In order to succesfully be resumed at
a later point, the owner of this object should have an END block which saves
the Contized object to long-term storage.

The resume method is called by the program after it has restored the Contized
object from long-term storage. This restores the objects internal state so that
subsequent calls to its methods will (more or less) pick up right where they
left off. So, if you have a CGI::Session object for example, you might have
something like this:

  my $obj = $session->param('obj') || new Contize(new MyObj);
  $obj->resume();
  $obj->run();

Fun, eh? Also see http://thelackthereof.org/wiki.pl/Contize

INSTALLATION

To install this module type the following:

   perl Makefile.PL
   make
   make test
   make install

DEPENDENCIES

This module requires doesn't have any extra dependencies, I think.

COPYRIGHT AND LICENCE

Copyright (C) 2004 by Brock Wilcox <[email protected]>

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.4 or,
at your option, any later version of Perl 5 you may have available.


contize's People

Contributors

awwaiid avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.