NAME

POE::Component::Q4M - Access Q4M From POE

SYNOPSIS

POE::Session->create(
  inline_states => {
    _start => sub {
      POE::Component::Q4M->spawn(
        alias => 'Q4m',
        table => 'q4m',
        connect_info => [ ... ],
      );
      $_[KERNEL]->post('Q4M', 'next', {
        event   => 'got_message',
        method  => 'fetchrow_hashref',
        fields  => [ qw(col1 col2 col3) ]
      });
    }
    got_message => sub {
      my $h = $_[ARG0];
      print $h->{col1}, "\n";
    }
  }
);

DESCRIPTION

POE::Component::Q4M is a simple POE wrapper around Q4M.

METHODS

spawn

POE::Component::Q4M->spawn(
  alias        => $alias, # default Q4M
  table        => $table, # required
  connect_info => \@connet_info, # required
);

Creates a new Q4M session.

STATES

next

$kernel->post(Q4M => 'next', {
  event => $event, # name or ID of event to receive response
  session => $session, # default $_[SENDER]
  method => 'fetchrow_hashref',
  fields => [ qw(col1 col2 col3) ]
});

Grabs the next row, and passes the result to 'event'

TODO

Need to implment "insert".

Not sure if we want to pass the results from the backend directly to the final event

Error handling.

AUTHOR

Copyright (c) 2008 Daisuke Maki <daisuke@endeworks.jp>

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html