From jofell at xackup.org Mon Aug 13 08:50:56 2007 From: jofell at xackup.org (Jofell Gallardo) Date: Mon, 13 Aug 2007 20:50:56 +0800 Subject: [sqlite-ruby-users] Busy Handler Question Message-ID: <6eeeb2b10708130550o7f871c61l37b14d22caa7015@mail.gmail.com> I searched google about ruby's busy_handler support for SQLite3, and the only link I saw which gave an example was this: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/162334 The documentation tells me that the "data" parameter in it is an object that would be used for the busy handler callback. Digging the code shows that each call for SQLite3::Database.busy_handler should declare a corresponding block that should do processing and return whether true or false, depending on the given data and number of retries. The question is: What if I want to set the block as a common / globally-declared block (a Proc instance, perhaps) and fee it to the method's hidden second argument (being the block)? I actually tried this one, but with no luck of making it work. Can someone give a ruby-sqlite3 noobie some advice on how to do this (globally-declared Proc instance for blocks as busy handlers). Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/sqlite-ruby-users/attachments/20070813/5d2e2670/attachment.html