Classe: Mongo::Monitoring::Event::TopologyChanged

Herda:
Evento::Base
  • Objeto
mostrar tudo
Definido em:
lib/mongo/monitoring/ evento/topology_changed.rb

Visão geral

Evento disparado quando a topologia muda.

Desde:

  • 2.4.0

Recolhimento do Resumo do atributo de instância

Recolhimento do Resumo do método de instância

Detalhes do construtor

#initialize(previous_topology, new_topology) ➤ TopologyChanged

Crie o evento.

Exemplos:

Crie o evento.

TopologyChanged.new(previous, new)

Parâmetros:

Desde:

  • 2.4.0



39
40
41
42
# File 'lib/mongo/monitoring/ evento/topology_changed.rb', linha 39

def inicializar(anterior_topologia, new_topology)
  @previous_topology = anterior_topologia
  @new_topology = new_topology
end

Detalhes do atributo da instância

#new_topology ➤ Cluster::Topology (readonly)

Retorna new_topology A nova topologia.

Retorna:

Desde:

  • 2.4.0



28
29
30
# File 'lib/mongo/monitoring/ evento/topology_changed.rb', linha 28

def new_topology
  @new_topology
end

#Previous_topologyCluster::Topology (readonly)

Retorna anterior_topologia A topologia anterior.

Retorna:

Desde:

  • 2.4.0



25
26
27
# File 'lib/mongo/monitoring/ evento/topology_changed.rb', linha 25

def anterior_topologia
  @previous_topology
end

Detalhes do método de instância

#resumostring

Observação:

Este método é experimental e sujeito a alterações.

Retorna um resumo conciso, mas útil, do evento.

Retorna:

  • (string)

    resumo de string do evento.

Desde:

  • 2.7.0



52
53
54
55
56
# File 'lib/mongo/monitoring/ evento/topology_changed.rb', linha 52

def Resumo
  "#<#{curto_class_name}" +
    " prev=#{anterior_topologia.resumo}" +
    " new=#{new_topology.resume}>"
end