Class: Mongo::Server::PendingConnection Private
- Inherits:
-
ConnectionBase
- Object
- ConnectionCommon
- ConnectionBase
- Mongo::Server::PendingConnection
- Extended by:
- Forwardable
- Defined in:
- lib/mongo/server/pending_connection.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
This class encapsulates connections during handshake and authentication.
Constant Summary
Constants inherited from ConnectionBase
ConnectionBase::DEFAULT_MAX_BSON_OBJECT_SIZE, ConnectionBase::MAX_BSON_COMMAND_OVERHEAD, ConnectionBase::REDUCED_MAX_BSON_SIZE
Constants included from Loggable
Instance Attribute Summary collapse
-
#id ⇒ Integer
readonly
private
The ID for the connection.
Attributes inherited from ConnectionBase
#description, #options, #server
Attributes included from Monitoring::Publishable
Attributes inherited from ConnectionCommon
Instance Method Summary collapse
- #ensure_connected {|@socket| ... } ⇒ Object private
-
#initialize(socket, description, server, monitoring, options = {}) ⇒ PendingConnection
constructor
private
A new instance of PendingConnection.
Methods inherited from ConnectionBase
Methods included from Monitoring::Publishable
#publish_cmap_event, #publish_event, #publish_sdam_event
Methods included from Loggable
#log_debug, #log_error, #log_fatal, #log_info, #log_warn, #logger
Constructor Details
#initialize(socket, description, server, monitoring, options = {}) ⇒ PendingConnection
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of PendingConnection.
24 25 26 27 28 29 30 31 |
# File 'lib/mongo/server/pending_connection.rb', line 24 def initialize(socket, description, server, monitoring, = {}) @socket = socket @description = description @options = @server = server @monitoring = monitoring @id = [:id] end |
Instance Attribute Details
#id ⇒ Integer (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns The ID for the connection. This is the same ID as that of the regular Connection object for which this PendingConnection instance was created.
36 37 38 |
# File 'lib/mongo/server/pending_connection.rb', line 36 def id @id end |
Instance Method Details
#ensure_connected {|@socket| ... } ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
38 39 40 |
# File 'lib/mongo/server/pending_connection.rb', line 38 def ensure_connected yield @socket end |