Method: EM::Mongo::EMConnection#unbind
- Defined in:
- lib/em-mongo/connection.rb
#unbind ⇒ Object
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
# File 'lib/em-mongo/connection.rb', line 186 def unbind if @is_connected @responses.values.each { |resp| resp.call(:disconnected) } @request_id = 0 @responses = {} end @is_connected = false set_deferred_status(nil) if @reconnect_in && @retries < MAX_RETRIES EM.add_timer(@reconnect_in) { reconnect(@host, @port) } elsif @on_unbind @on_unbind.call else raise "Connection to Mongo Lost" end @retries += 1 end |