debian man page for poe::component::dbiagent::helper

Query: poe::component::dbiagent::helper

OS: debian

Section: 3pm

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

DBIAgent::Helper(3pm)					User Contributed Perl Documentation				     DBIAgent::Helper(3pm)

NAME
POE::Component::DBIAgent::Helper - DBI Query Helper for DBIAgent
SYNOPSYS
use Socket qw/:crlf/; use POE qw/Filter::Line Wheel::Run Component::DBIAgent::Helper/; sub _start { my $helper = POE::Wheel::Run ->new( Program => sub { POE::Component::DBIAgent::Helper->run($self->{dsn}, $self->{queries} ); }, StdoutEvent => 'db_reply', StderrEvent => 'remote_stderr', ErrorEvent => 'error', StdinFilter => POE::Filter::Line->new(), StdoutFilter => POE::Filter::Line->new( Literal => CRLF), StderrFilter => POE::Filter::Line->new(), ) or carp "Can't create new DBIAgent::Helper: $! "; } sub query { my ($self, $query, $package, $state, @rest) = @_; $self->{helper}->put(join '|', $query, $package, $state, @rest); } sub db_reply { my ($kernel, $self, $heap, $input) = @_[KERNEL, OBJECT, HEAP, ARG0]; # $input is either the string 'EOF' or a Storable object. }
DESCRIPTION
This is our helper routine for DBIAgent. It accepts queries on STDIN, and returns the results on STDOUT. Queries are returned on a row- by-row basis, followed by a row consisting of the string 'EOF'. Each row is the return value of $sth->fetch, which is an arrayref. This row is then passed to Storable for transport, and printed to STDOUT. HOWEVER, Storable uses newlines (" ") in its serialized strings, so the Helper is designed to use the "network newline" pair CR LF as the line terminator for STDOUT. When fetch() returns undef, one final row is returned to the calling state: the string 'EOF'. Sessions should test for this value FIRST when being invoked with input from a query. Initialization The Helper has one public subroutine, called "run()", and is invoked with two parameters: The DSN An arrayref of parameters to pass to DBI->connect (usually a dsn, username, and password). The Queries. A hashref of the form Query_Name => "$SQL". See POE::Component::DBIAgent for details.
BUGS
I have NO idea what to do about handling signals intelligently. Specifically, under some circumstances, Oracle will refuse to acknowledge SIGTERM (presumably since its libraries are non-reentrant) so sometimes SIGKILL is required to terminate a Helper process.
AUTHOR
This module has been fine-tuned and packaged by Rob Bloodgood <robb@empire2.com>. However, most of the code came directly from Fletch <fletch@phydeaux.org>, either directly (Po:Co:DBIAgent:Queue) or via his ideas. Thank you, Fletch! However, I own all of the bugs. This module is free software; you may redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2008-01-18 DBIAgent::Helper(3pm)
Related Man Pages
poe::component::dbiagent(3pm) - debian
poe::component::irc::cookbook::resolver(3pm) - debian
poe::component::irc::plugin::connector(3pm) - debian
poe::component::irc::plugin::followtail(3pm) - debian
poe::filter::httpchunk(3pm) - debian
Similar Topics in the Unix Linux Community
Installing Dash Shell on OS X Lion
awk or sed - Convert 2 lines to 1 line
One instance of comparing grep and awk
A (ksh) Library For and From UNIX.com
How to copy a column of multiple files and paste into new excel file (next to column)?