From: "Artūras Šlajus" Date: 2009-09-10T21:27:24+09:00 Subject: Re: EventMachine.defer and ActiveRecord connection pool? Chuck Remes wrote: > Look up #release_connection in > ActiveRecord::ConnectionAdapters::ConnectionPool. It does exactly what > you need whereas that call to #clear_reloadable_connections! might be > doing unnecessary work. Unfortunately that doesn't work :) EventMachine.defer( proc do SingletonBlock.started(name) LOGGER.block(name) { operation.call } end, proc do LOGGER.block("#{name} CALLBACK") { callback.call } if callback SingletonBlock.finished(name) ActiveRecord::Base.connection_pool.release_connection #ActiveRecord::Base.clear_reloadable_connections! end ) Still hangs :) -- Posted via http://www.ruby-forum.com/.