Class: Mongo::Cluster::SocketReaper Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/mongo/cluster/reapers/socket_reaper.rb |
Overview
A manager that calls a method on each of a cluster’s pools to close idle
sockets.
Class Method Summary
-
.new(cluster) ⇒ SocketReaper
constructor
Internal use only
Initialize the
SocketReaper
object.
Instance Method Summary
Instance Method Details
#execute
Execute the operation to close the pool’s idle sockets.
# File 'lib/mongo/cluster/reapers/socket_reaper.rb', line 49
def execute @cluster.servers.each do |server| server.pool_internal&.close_idle_sockets end true end
#flush
When the socket reaper is garbage-collected, there’s no need to close
idle sockets; sockets will be closed anyway when the pools are
garbage collected.
# File 'lib/mongo/cluster/reapers/socket_reaper.rb', line 61
def flush end