Class: EM::Mongo::Connection
- Inherits:
-
Object
- Object
- EM::Mongo::Connection
- Defined in:
- lib/em-synchrony/em-mongo.rb
Instance Method Summary collapse
-
#initialize(host = DEFAULT_IP, port = DEFAULT_PORT, timeout = nil, opts = {}) ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize(host = DEFAULT_IP, port = DEFAULT_PORT, timeout = nil, opts = {}) ⇒ Connection
Returns a new instance of Connection.
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/em-synchrony/em-mongo.rb', line 30 def initialize(host = DEFAULT_IP, port = DEFAULT_PORT, timeout = nil, opts = {}) f = Fiber.current @em_connection = EMConnection.connect(host, port, timeout, opts) @db = {} # establish connection before returning EM.next_tick { f.resume } Fiber.yield end |