From dfcf8d9d603a1b5558ac494b647749f1383f9f2c Mon Sep 17 00:00:00 2001 From: Steve Sloan Date: Sat, 14 Aug 2010 23:04:12 -0700 Subject: [PATCH] Moved thread and socket classes into Connection for easy overriding. This is necessary for use under em-synchrony, which uses Fibers instead of Threads and EventMachine instead of blocking sockets. --- lib/mongo/connection.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/mongo/connection.rb b/lib/mongo/connection.rb index b8b5d29..25f9b98 100644 --- a/lib/mongo/connection.rb +++ b/lib/mongo/connection.rb @@ -24,6 +24,9 @@ module Mongo # Instantiates and manages connections to MongoDB. class Connection + TCPSocket = ::TCPSocket + Mutex = ::Mutex + ConditionVariable = ::ConditionVariable # Abort connections if a ConnectionError is raised. Thread.abort_on_exception = true