Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    POE::Session 0.9989

    Download button

    No screenshots available
    Downloads: 341  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    The POE authors | More programs
    Perl Artistic License / FREE
    April 18th, 2007, 21:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    POE::Session description

    POE::Session is a Perl module for event driven abstract state machine.

    POE::Session is a Perl module for event driven abstract state machine.

    SYNOPSIS

    # Import POE::Session constants.
    use POE::Session;

    POE::Session->create(

    # Inline or coderef states.
    inline_states => {
    state_one => &coderef_one,
    state_two => sub { ... },
    },

    # Plain and mapped object states.
    object_states => [
    $object_one => [ 'state_three', 'state_four', 'state_five' ],
    $object_two => { state_nine => 'method_nine' },
    ],

    # Plain and mapped package states.
    package_states => [
    $package_one => [ 'state_six', 'state_seven', 'state_eight' ],
    $package_two => { state_ten => 'method_ten' },
    ],

    # Parameters for the session's _start state.
    args => [ argument_zero, argument_one, ... ],

    # Initial options. See the option() method.
    options => %options,

    # Change the session's heap representation.
    heap => [ ],
    );
    Other methods:
    # Retrieve a session's unique identifier.
    $session_id = $session->ID;

    # Retrieve a reference to the session's heap.
    $session_heap = $session->get_heap();

    # Set or clear session options.
    $session->option( trace => 1, default => 1 );
    $session->option( trace );

    # Create a postback, then invoke it and pass back additional
    # information.
    $postback_coderef = $session->postback( $state_name, @state_args );
    $postback_coderef->( @additional_args );

    # Or do the same thing synchronously
    $callback_coderef = $session->callback( $state_name, @state_args );
    $retval = $callback_coderef->( @additional_args );

    POE::Session combines a runtime context with an event driven state machine. Together they implement a simple cooperatively timesliced thread.
    Sessions receive their timeslices as events from POE::Kernel. Each event has two fields, a state name and a session identifier. These fields describe the code to run and the context to run it in, respectively.

    Events carry several other fields which will be discussed in the "Predefined Event Fields" section.

    States are re-entrant since they are invoked with their runtime contexts. Although it's not usually necessary, this re-entrancy allows a single function to be bound to several different sessions, under several different state names.
    As sessions run, they post new events through the Kernel. These events may be for themselves or other sessions, in which case they act as a form of inter-session communications. The Kernel can also generate events based on external conditions such as file activity or the passage of time.

    POE provides some convenient built-in states with special meanings. They will be covered later on in the "Predefined States" section.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    event driven | state machine | Perl module | POE::Session | event | driven

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM