Class: Mongo::Cluster::SocketReaper Private
- Inherits:
-
Object
- Object
- Mongo::Cluster::SocketReaper
- Defined in:
- lib/mongo/cluster/reapers/socket_reaper.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.
A manager that calls a method on each of a cluster’s pools to close stale
sockets.
Instance Method Summary collapse
-
#execute ⇒ Object
private
Execute the operation to close the pool’s stale sockets.
-
#flush ⇒ Object
private
When the socket reaper is garbage-collected, there’s no need to close stale sockets; sockets will be closed anyway when the pools are garbage-collected.
-
#initialize(cluster) ⇒ SocketReaper
constructor
private
Initialize the SocketReaper object.
Constructor Details
#initialize(cluster) ⇒ SocketReaper
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.
Initialize the SocketReaper object.
36 37 38 |
# File 'lib/mongo/cluster/reapers/socket_reaper.rb', line 36 def initialize(cluster) @cluster = cluster end |
Instance Method Details
#execute ⇒ 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.
Execute the operation to close the pool’s stale sockets.
46 47 48 49 50 |
# File 'lib/mongo/cluster/reapers/socket_reaper.rb', line 46 def execute @cluster.servers.each do |server| server.pool.close_stale_sockets! end and true end |
#flush ⇒ 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.
When the socket reaper is garbage-collected, there’s no need to close stale sockets;
sockets will be closed anyway when the pools are garbage-collected.
56 |
# File 'lib/mongo/cluster/reapers/socket_reaper.rb', line 56 def flush; end |