class Mongo::Server::Description::Inspector::DescriptionChanged
Handles inspecting the result of an ismaster command for servers added to the cluster.
@since 2.0.0
Public Class Methods
new(event_listeners)
click to toggle source
Instantiate the server added inspection.
@example Instantiate the inspection.
ServerAdded.new(listeners)
@param [ Event::Listeners
] event_listeners The event listeners.
@since 2.0.0
# File lib/mongo/server/description/inspector/description_changed.rb, line 35 def initialize(event_listeners) @event_listeners = event_listeners end
Public Instance Methods
run(description, updated)
click to toggle source
Run the server added inspection.
@example Run the inspection.
ServerAdded.run(description, {})
@param [ Description
] description The server description. @param [ Description
] updated The updated description.
@since 2.0.0
# File lib/mongo/server/description/inspector/description_changed.rb, line 48 def run(description, updated) unless (description.unknown? && updated.unknown?) || (description == updated) publish(Event::DESCRIPTION_CHANGED, description, updated) end end