DB::Evented - A pragmatic DBI like evented module.
Doing selects in synchronise order is not always the most efficient way to interact with the Database.
use DB::Evented; my $evented = DB::Evented->new("DBI:SQLite2:dbname=$dname", "",""); my $results; $evented->selectcol_arrayref( q{ select test1, test2 from test }, { Columns => [1,2], response => sub { $results->{result1} = shift; } } ); $evented->selectrow_hashref( q{ select test1, test2 from test }, { response => sub { $results->{result2} = shift; } } ); $evented->execute_in_parallel;
In order to initialize a DB::Evented object a connection_str is most likely required. See AnyEvent::DBI for more information.
This will return an AnyEvent::DBI handler. The key difference between this handler and DBI is that it's using AnyEvent under the hood. What does this mean? It means that if you use an AnyEvent::DBI method it will run asynchronously.
Clears all handlers
Clears the queue of any db todos
Will execute all of the queued statements in parallel. This will create a pool of handlers and cache them if necessary.
This method functions in the same way as DBI::selectall_arrayref. The key difference being it delays the execution until execute_in_parallel has been called. The results can be accessed in the response attribute call back
This method functions in the same way as DBI::selectall_hashref. The key difference being it delays the execution until execute_in_parallel has been called. The results can be accessed in the response attribute call back
This method functions in the same way as DBI::selectrow_arrayref. The key difference being it delays the execution until execute_in_parallel has been called. The results can be accessed in the response attribute call back
This method functions in the same way as DBI::selectrow_hashref. The key difference being it delays the execution until execute_in_parallel has been called. The results can be accessed in the response attribute call back
Logan Bell, <logie at cpan.org>
<logie at cpan.org>
You can find documentation for this module with the perldoc command.
perldoc DB::Evented
You can also look for information at:
Aaron Cohen and Belden Lyman.
Copyright (c) 2013 Logan Bell and Shutterstock Inc (http://shutterstock.com). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install DB::Evented, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DB::Evented
CPAN shell
perl -MCPAN -e shell install DB::Evented
For more information on module installation, please visit the detailed CPAN module installation guide.