ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro-Mysql/Mysql.pm
(Generate patch)

Comparing Coro-Mysql/Mysql.pm (file contents):
Revision 1.4 by root, Sat Jul 18 05:58:27 2009 UTC vs.
Revision 1.8 by root, Thu Jan 13 12:08:56 2011 UTC

20This can be used to make parallel sql requests using Coro, or to do other 20This can be used to make parallel sql requests using Coro, or to do other
21stuff while mysql is rumbling in the background. 21stuff while mysql is rumbling in the background.
22 22
23=head2 CAVEAT 23=head2 CAVEAT
24 24
25Note that this module must be linked against exactly the same 25Note that this module must be linked against exactly the same (shared,
26F<libmysqlclient> library as DBD::mysql, otherwise it will not work. 26possibly not working with all OSes) F<libmysqlclient> library as
27DBD::mysql, otherwise it will not work.
27 28
28Also, while this module makes database handles non-blocking, you still 29Also, while this module makes database handles non-blocking, you still
29cannot run multiple requests in parallel on the same database handle. If 30cannot run multiple requests in parallel on the same database handle. If
30you want to run multiple queries in parallel, you have to create multiple 31you want to run multiple queries in parallel, you have to create multiple
31database connections, one for each thread that runs queries. Not doing so 32database connections, one for each thread that runs queries. Not doing so
50 51
51For very fast queries ("select 0"), this module can add noticable overhead 52For very fast queries ("select 0"), this module can add noticable overhead
52(around 15%) as it tries to switch to other coroutines when mysqld doesn't 53(around 15%) as it tries to switch to other coroutines when mysqld doesn't
53deliver the data instantly. 54deliver the data instantly.
54 55
55For most types of queries, there will be no overhead, especially on 56For most types of queries, there will be no extra latency, especially on
56multicore systems where your perl process can do other things while mysqld 57multicore systems where your perl process can do other things while mysqld
57does its stuff. 58does its stuff.
58 59
59=head2 LIMITATIONS 60=head2 LIMITATIONS
60 61
87 88
88sub readable { &Coro::Handle::FH::readable } 89sub readable { &Coro::Handle::FH::readable }
89sub writable { &Coro::Handle::FH::writable } 90sub writable { &Coro::Handle::FH::writable }
90 91
91BEGIN { 92BEGIN {
92 our $VERSION = '1.0'; 93 our $VERSION = '1.02';
93 94
94 require XSLoader; 95 require XSLoader;
95 XSLoader::load Coro::Mysql::, $VERSION; 96 XSLoader::load Coro::Mysql::, $VERSION;
96} 97}
97 98

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines