Module: Mongo::Server::Connectable
- Included in:
- Connection, Monitor::Connection
- Defined in:
- lib/mongo/server/connectable.rb
Overview
This provides common behavior for connection objects.
Constant Summary collapse
- SSL =
Deprecated.
The ssl option prefix.
'ssl'.freeze
- TIMEOUT =
Deprecated.
Timeouts on Ruby sockets aren’t effective so this default option is no longer used. Will be removed in driver version 3.0.
The default time in seconds to timeout an operation executed on a socket.
5.freeze
Instance Attribute Summary collapse
-
#pid ⇒ Integer
readonly
Pid The process id when the connection was created.
Instance Method Summary collapse
-
#connectable? ⇒ true, false
deprecated
Deprecated.
No longer necessary with Server Selection specification.
-
#connected? ⇒ true, false
deprecated
Deprecated.
Use #connectable? instead
Instance Attribute Details
#pid ⇒ Integer (readonly)
Returns pid The process id when the connection was created.
38 39 40 |
# File 'lib/mongo/server/connectable.rb', line 38 def pid @pid end |
Instance Method Details
#connectable? ⇒ true, false
Deprecated.
No longer necessary with Server Selection specification.
Determine if the server is connectable. This will check not only if the connection exists, but if messages can send to it successfully.
51 |
# File 'lib/mongo/server/connectable.rb', line 51 def connectable?; end |
#connected? ⇒ true, false
Deprecated.
Use #connectable? instead
Determine if the connection is currently connected.
61 62 63 |
# File 'lib/mongo/server/connectable.rb', line 61 def connected? !!@socket && @socket.alive? end |