NAME

POE::Component::Runner - Create a session for running an arbitrary process.

SYNOPSIS

use POE qw( Component::Runner );

my %runner = (
    alias       => 'runner',
    function_rc => \&arbitrary_function,

    # optional
    callback_rh => {
        stdout => \&stdout_handler,
        stderr => \&stderr_handler,
        close  => \&close_handler,
        signal => \&signal_handler,
    },
    debug => 0,
);
POE::Component::Runner->new( \%runner );

  ...

POE::Kernel->post( runner => 'run', \@args );

  ...

POE::Kernel->post( runner => 'run', \@args, $task_key );

DESCRIPTION

This component provides a session with a 'run' state for facilitating asynchronous calls to otherwise blocking code. You can optionally provide callback handlers for the various underlying POE::Wheel::Run states.

Take a look in the example directory to see how to use it with POE::Component::DirWatch to asynchronously move files.

SEE ALSO

POE::Wheel::Run

ACKNOWLEDGEMENT

This module was inspired by the synopsis on Rocco Caputo's POE::Wheel::Run.

AUTHOR

Dylan Doxey, <dylan.doxey@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2012 by Dylan Doxey

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