RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

new mysql driver

A new mysql driver that spun off from NeverBlock, this one supports async operations and multi-threaded access

Comments

Awesome! What’s the Ruby version compatibility on this?

@PeterCooper: seems to work on both MRI 1.8 and 1.9.

That said, multi-threaded access is only possible if you use it with Mysql#socket and Kernel#select. If you use Mysql#query then it will block all MRI 1.8 userspace threads just like the “old” mysql driver. If you use Mysql#socket with Kernel#select, then MRI 1.8 will be able to use its own internal non-blocking I/O implementation to make sure that threads can still be scheduled.

A new method (async_query) is provided so you don’t need to deal with socket and select and still benefit from multithreading

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in