Method: Mongo::Monitoring::Event::ServerDescriptionChanged#initialize

Defined in:
lib/mongo/monitoring/event/server_description_changed.rb

#initialize(address, topology, previous_description, new_description, awaited: false) ⇒ ServerDescriptionChanged

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Create the event.

Examples:

Create the event.

ServerDescriptionChanged.new(address, topology, previous, new)

Parameters:

  • address (Address)

    The server address.

  • topology (Integer)

    The topology.

  • previous_description (Server::Description)

    The previous description.

  • new_description (Server::Description)

    The new description.

  • awaited (true | false) (defaults to: false)

    Whether the server description was a result of processing an awaited hello response.

Since:

  • 2.4.0



62
63
64
65
66
67
68
69
70
# File 'lib/mongo/monitoring/event/server_description_changed.rb', line 62

def initialize(address, topology, previous_description, new_description,
  awaited: false
)
  @address = address
  @topology = topology
  @previous_description = previous_description
  @new_description = new_description
  @awaited = !!awaited
end