# File lib/mongo/server/monitor.rb, line 150 def scan! throttle_scan_frequency! result = ismaster new_description = Description.new(description.address, result, @round_trip_time_averager.average_round_trip_time) publish(Event::DESCRIPTION_CHANGED, description, new_description) # If this server's response has a mismatched me, or for other reasons, # this server may be removed from topology. When this happens the # monitor thread gets killed. As a result, any code after the publish # call may not run in a particular monitor instance, hence there # shouldn't be any code here. @description = new_description # This call can be after the publish event because if the # monitoring thread gets killed the server is closed and no client # should be waiting for it if options[:server_selection_semaphore] options[:server_selection_semaphore].broadcast end @description end