Skip to content

Instantly share code, notes, and snippets.

@adamlwatson
Created November 16, 2011 21:56

Revisions

  1. adamlwatson revised this gist Nov 16, 2011. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    require 'em-synchrony/em-mongo'
    require 'mongoid'

    mongoid_conn = Mongo::Connection.new 'localhost', 27017, :pool_size => 10
  2. adamlwatson created this gist Nov 16, 2011.
    11 changes: 11 additions & 0 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    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