You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, "mysqlplus" (and of course also "mysql") driver blocks totally the Ruby process when it's trying to connect to a MySQL server. In case the server doesn't respond then we get our Tuby application stopped forever.
To create a non-blocking connection you need to provide a timeout (works in all mysql libs) as by default there is no connect timeout defined.
con = Mysql.init
con.options(Mysql::OPT_CONNECT_TIMEOUT, 5) # 5 second timeout
Hi, "mysqlplus" (and of course also "mysql") driver blocks totally the Ruby process when it's trying to connect to a MySQL server. In case the server doesn't respond then we get our Tuby application stopped forever.
Please check the following code which shows the issue:
http://gist.github.com/264866
Is it possible to make MySQL connection non-blocking?
Regards.
The text was updated successfully, but these errors were encountered: