9 May 2011 20:24
DBD::mysql 4.019 Released
Patrick Galbraith <patg <at> patg.net>
2011-05-09 18:24:21 GMT
2011-05-09 18:24:21 GMT
Dear Perl and MySQL enthusiasts, I’m pleased to announce the release of DBD::mysql 4.019. I’m especially pleased because there are some new enhancements and features that have been provided by contributions from the community: * Asynchronous support, added by Rob Hoelz. This is a new feature to DBD::mysql that takes advantage of libmysql’s asynchronous functions (see Jan’s article from 2008 http://jan.kneschke.de/2008/9/9/async-mysql-queries-with-c-api/) . From the DBD::mysql documentation: You can make a single asynchronous query per MySQL connection; this allows you to submit a long-running query to the server and have an event loop inform you when it’s ready. An asynchronous query is started by either setting the ‘async’ attribute to a true value in the DBI do() method, or in the DBI prepare() method. Statements created with async set to true in prepare always run their queries asynchronously when DBI execute() is called. The driver also offers three additional methods: mysql_async_result, mysql_async_ready(), and mysql_fd. mysql_async_result() returns what do or execute would have; that is, the number of rows affected. mysql_async_ready() returns true if mysql_async_result() will not block, and zero otherwise. They both return undef if that handle is not currently running an asynchronous query. mysql_fd returns the file descriptor number for the MySQL connection; you can use this in an event loop. use feature 'say'; $dbh->do('SELECT SLEEP(10)', { async => 1 });(Continue reading)
RSS Feed