Data::Model::Driver::Queue::Q4M - Q4M manager for Data::Model
use Data::Model::Driver::Queue::Q4M; my $driver = Data::Model::Driver::Queue::Q4M->new( dsn => 'dbi:mysql:database=test', username => '', password => '', timeout => 60, # queue_wait timeout ); { package MyQueue; use base 'Data::Model'; use Data::Model::Mixin modules => ['Queue::Q4M']; use Data::Model::Schema; base_driver $driver; install_model smtp => schema { column id => char => {}; column data => int => {}; }; install_model pop => schema { column id => char => {}; column data => int => {}; }; } my $model = MyQueue->new; # add queue $model->set( smtp => { id => 'foo', data => 1, } ); # same queue_wait('smtp', 'pop', 10); my $retval = $model->queue_running( smtp => sub { my $row = shift; is($row->id, 'foo'); is($row->data, 1); }, pop => sub { my $row = shift; }, timeout => 10, # optional ); # same queue_wait('smtp:data>10'); my $retval = $model->queue_running( 'smtp:data>10' => sub { my $row = shift; is($row->id, 'foo'); is($row->data, 1); }, ); ok($retval); # explicit abort my $retval = $model->queue_running( 'smtp:data>10' => sub { my $row = shift; is($row->id, 'foo'); is($row->data, 1); $model->queue_abort; # queue is aborted }, ); ok(!$retval);
Since Q4M works on MySQL, it has inherited Data::Model::Driver::DBI inevitably.
Q4M http://q4m.31tools.com/, Data::Model::Mixin::Queue::Q4M, Data::Model::Mixin::DBI, Data::Model
Kazuhiro Osawa <yappo <at> shibuya <döt> pl>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in '<döt>'. Assuming UTF-8
To install Data::Model, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Model
CPAN shell
perl -MCPAN -e shell install Data::Model
For more information on module installation, please visit the detailed CPAN module installation guide.