Class: Mongo::Event::StandaloneDiscovered

Inherits:
Object
  • Object
show all
Defined in:
lib/mongo/event/standalone_discovered.rb

Overview

This handles when a standalone is discovered.

Since:

  • 2.0.6

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cluster) ⇒ StandaloneDiscovered

Initialize the new standalone discovered event handler.

Examples:

Create the new handler.

StandaloneDiscovered.new(cluster)

Parameters:

Since:

  • 2.0.6



34
35
36
# File 'lib/mongo/event/standalone_discovered.rb', line 34

def initialize(cluster)
  @cluster = cluster
end

Instance Attribute Details

#clusterMongo::Cluster (readonly)

Returns cluster The cluster.

Returns:

Since:

  • 2.0.6



24
25
26
# File 'lib/mongo/event/standalone_discovered.rb', line 24

def cluster
  @cluster
end

Instance Method Details

#handle(description) ⇒ Object

This event tells the cluster to notify its topology that a standalone was discovered.

Examples:

Handle the event.

standalone_discovered.handle(description)

Parameters:

Since:

  • 2.0.6



48
49
50
# File 'lib/mongo/event/standalone_discovered.rb', line 48

def handle(description)
  cluster.standalone_discovered
end