Skip to content

Commit

Permalink
Example tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
lifo committed Aug 5, 2011
1 parent 5463f30 commit 22002f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/fibers/active_record.ru
Expand Up @@ -5,7 +5,7 @@ Bundler.setup(:default, :example)
require 'cramp'
require 'active_record'

ActiveRecord::Base.establish_connection(:adapter => "em_mysql2", :username => 'root', :database => "arel_development")
ActiveRecord::Base.establish_connection(:adapter => "em_mysql2", :username => 'root', :database => "arel_development", :pool => 100)

class User < ActiveRecord::Base
validates_presence_of :name
Expand Down
5 changes: 4 additions & 1 deletion examples/fibers/long_ar_query.ru
Expand Up @@ -12,7 +12,10 @@ class User < ActiveRecord::Base
end

class LongQueryController < Cramp::Action
use_fiber_pool
use_fiber_pool do |pool|
# Called everytime after a fiber is done a callback
pool.generic_callbacks << proc { ActiveRecord::Base.clear_active_connections! }
end

on_start :run_srsly_long_query

Expand Down

0 comments on commit 22002f1

Please sign in to comment.