123456789_123456789_123456789_123456789_123456789_

Class: Mongo::Monitoring::Event::TopologyChanged

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Mongo::Event::Base
Defined in: lib/mongo/monitoring/event/topology_changed.rb

Overview

::Mongo::Monitoring::Event fired when the topology changes.

Since:

  • 2.4.0

Class Method Summary

Instance Attribute Summary

Instance Method Summary

::Mongo::Event::Base - Inherited

#summary

Returns a concise yet useful summary of the event.

#short_class_name

Constructor Details

.new(previous_topology, new_topology) ⇒ TopologyChanged

Create the event.

Examples:

Create the event.

TopologyChanged.new(previous, new)

Parameters:

Since:

  • 2.4.0

[ GitHub ]

  
# File 'lib/mongo/monitoring/event/topology_changed.rb', line 42

def initialize(previous_topology, new_topology)
  @previous_topology = previous_topology
  @new_topology = new_topology
end

Instance Attribute Details

#new_topologyCluster::Topology (readonly)

Returns:

Since:

  • 2.4.0

[ GitHub ]

  
# File 'lib/mongo/monitoring/event/topology_changed.rb', line 31

attr_reader :new_topology

#previous_topologyCluster::Topology (readonly)

Returns:

Since:

  • 2.4.0

[ GitHub ]

  
# File 'lib/mongo/monitoring/event/topology_changed.rb', line 28

attr_reader :previous_topology

Instance Method Details

#summaryString

Note:

This method is experimental and subject to change.

Returns a concise yet useful summary of the event.

Returns:

  • (String)

    String summary of the event.

Since:

  • 2.7.0

[ GitHub ]

  
# File 'lib/mongo/monitoring/event/topology_changed.rb', line 55

def summary
  "#<#{short_class_name}" +
  " prev=#{previous_topology.summary}" +
  " new=#{new_topology.summary}>"
end