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.
This commit is contained in:
Steve Sloan 2010-08-14 23:04:12 -07:00 committed by Kyle Banker
parent 02a0c7c2dc
commit dfcf8d9d60
1 changed files with 3 additions and 0 deletions

View File

@ -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