NAME

XAS::Lib::Pipe - Interact with named pipes

SYNOPSIS

 use XAS::Lib::Pipe;

 my $client = XAS::Lib::Pipe->new(
     -fifo   => File('/var/lib/xas/pipe'),
     -filter => POE::Filter::Line->new(),
     -eol    => "\n",
 );

 $client->run();

DESCRIPTION

The module provides a POE based framework for reading and writing to named pipes.

METHODS

new

This initializes the module and starts listening on the pipe. The following parametrs are used:

-alias

The name of the POE session.

-fifo

The name of the pipe to interact with.

-filter

An optional filter to use, defaults to POE::Filter::Line

-eol

An optional EOL, defaults to "\n";

process_input($input)

This method will process the input from the pipe. It takes the following parameters:

$input

The input received from the pipe.

process_output($output)

This method will process the output for the pipe. It takes the following parameters:

$output

The output to be sent to the pipe.

process_error($syscall, $errnum, $errstr)

This method will process any errors from the pipe. It takes the following parameters:

$syscall

The function that caused the error.

$errnum

The OS error number.

$errstr

The OS error string.

SEE ALSO

XAS

AUTHOR

Kevin L. Esteb, <kevin@kesteb.us>

COPYRIGHT AND LICENSE

Copyright (c) 2012-2016 Kevin L. Esteb

This is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0. For details, see the full text of the license at http://www.perlfoundation.org/artistic_license_2_0.