Created
November 16, 2011 21:56
-
-
Save adamlwatson/1371577 to your computer and use it in GitHub Desktop.
Mongoid connection pooling in Goliath
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'em-synchrony/em-mongo' | |
require 'mongoid' | |
mongoid_conn = Mongo::Connection.new 'localhost', 27017, :pool_size => 10 | |
Mongoid.configure do |config| | |
begin | |
config.master = mongoid_conn.db('dbname') | |
rescue Exception=>err | |
abort "An error occurred while creating the mongoid connection pool: #{err}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment