Class: Mongo::Server::Description::Inspector::StandaloneDiscovered

Inherits:
Object
  • Object
show all
Includes:
Event::Publisher
Defined in:
lib/mongo/server/description/inspector/standalone_discovered.rb

Overview

Handles notifying the cluster that a standalone was discovered.

Since:

  • 2.0.6

Instance Attribute Summary

Attributes included from Event::Publisher

#event_listeners

Instance Method Summary collapse

Methods included from Event::Publisher

#publish

Constructor Details

#initialize(event_listeners) ⇒ StandaloneDiscovered

Instantiate the standalone discovered inspection.

Examples:

Instantiate the inspection.

StandaloneDiscovered.new(listeners)

Parameters:

Since:

  • 2.0.6



34
35
36
# File 'lib/mongo/server/description/inspector/standalone_discovered.rb', line 34

def initialize(event_listeners)
  @event_listeners = event_listeners
end

Instance Method Details

#run(description, updated) ⇒ Object

Run the standalone discovered inspection.

Examples:

Run the inspection.

StandaloneDiscovered.run(description, {})

Parameters:

Since:

  • 2.0.6



47
48
49
50
51
# File 'lib/mongo/server/description/inspector/standalone_discovered.rb', line 47

def run(description, updated)
  if !description.standalone? && updated.standalone?
    publish(Event::STANDALONE_DISCOVERED, updated)
  end
end