Hi Sujal,
Interesting... after initializing a Mongoid connection pool, I see this when I inspect Mongoid.master['primary_pool']:
=> #<Mongo::Collection:0x0000010319d710 @name="primary_pool", @db=#<Mongo::DB:0x000001033c4e80 @name="development", @connection=#<Mongo::Connection:0x000001033c7cc0 @host_to_try=["localhost", 27017], @port=nil, @host=nil, @slave_ok=nil, @max_bson_size=16777216, @ssl=false, @socket_class=TCPSocket, @auths=[], @id_lock=#<Mutex:0x000001033c7c48>, @pool_size=20, @timeout=5.0, @op_timeout=nil, @connect_timeout=nil, @connection_mutex=#<Mutex:0x000001033c7c20>, @safe=false, @safe_mutexes={#<TCPSocket:(closed)>=>#<Mutex:0x000001033c5858>, #<TCPSocket:fd 47>=>#<Mutex:0x000001033c3eb8>}, @queue=#<ConditionVariable:0x000001033c7b58 @waiters=[], @waiters_mutex=#<Mutex:0x000001033c7b08>>, @primary=["localhost", 27017], @primary_pool=#<Mongo::Pool:0x819e286c @host=localhost @port=27017 @ping_time= 0/20 sockets available.>, @logger=nil, @read_primary=true>, @strict=nil, @pk_factory=nil, @safe=false, @read_preference=:primary, @cache_time=300>, @connection=#<Mongo::Connection:0x000001033c7cc0 @host_to_try=["localhost", 27017], @port=nil, @host=nil, @slave_ok=nil, @max_bson_size=16777216, @ssl=false, @socket_class=TCPSocket, @auths=[], @id_lock=#<Mutex:0x000001033c7c48>, @pool_size=20, @timeout=5.0, @op_timeout=nil, @connect_timeout=nil, @connection_mutex=#<Mutex:0x000001033c7c20>, @safe=false, @safe_mutexes={#<TCPSocket:(closed)>=>#<Mutex:0x000001033c5858>, #<TCPSocket:fd 47>=>#<Mutex:0x000001033c3eb8>}, @queue=#<ConditionVariable:0x000001033c7b58 @waiters=[], @waiters_mutex=#<Mutex:0x000001033c7b08>>, @primary=["localhost", 27017], @primary_pool=#<Mongo::Pool:0x819e286c @host=localhost @port=27017 @ping_time= 0/20 sockets available.>, @logger=nil, @read_primary=true>, @cache_time=300, @cache={}, @safe=false, @read_preference=:primary, @pk_factory=BSON::ObjectId, @hint=nil>
I may be misinterpreting this, but it looks like mongoid has, in fact, created a connection pool. I assumed that Goliath would be able to take advantage of this since it can perform multiple concurrent requests.
However, now that I take another look at Ilya's EM-Synchrony readme, I'm noting that the Mongoid support states "all functions synchronous".
Hmm, now I'm a bit confused about this, too :)
Ilya, would you mind helping to clarify?
Cheers,
Adam