Class: Mongo::Monitoring::Event::Cmap::PoolClosed

Inherits:
Base show all
Defined in:
build/ruby-driver-v2.19/lib/mongo/monitoring/event/cmap/pool_closed.rb

Overview

Event published when a connection pool is closed.

Since:

  • 2.9.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(address, pool) ⇒ PoolClosed

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.

PoolClosed.new(address, pool)

Since:

  • 2.9.0



47
48
49
50
# File 'build/ruby-driver-v2.19/lib/mongo/monitoring/event/cmap/pool_closed.rb', line 47

def initialize(address, pool)
  @address = address
  @pool = pool
end

Instance Attribute Details

#addressMongo::Address (readonly)

Returns address The address of the server the pool’s connections will connect to.

Returns:

  • (Mongo::Address)

    address The address of the server the pool’s connections will connect to.

Since:

  • 2.9.0



32
33
34
# File 'build/ruby-driver-v2.19/lib/mongo/monitoring/event/cmap/pool_closed.rb', line 32

def address
  @address
end

#poolMongo::Server::ConnectionPool (readonly)

Returns pool The pool that was closed.

Returns:

Since:

  • 2.11.0



38
39
40
# File 'build/ruby-driver-v2.19/lib/mongo/monitoring/event/cmap/pool_closed.rb', line 38

def pool
  @pool
end

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.9.0



60
61
62
63
# File 'build/ruby-driver-v2.19/lib/mongo/monitoring/event/cmap/pool_closed.rb', line 60

def summary
  "#<#{self.class.name.sub(/^Mongo::Monitoring::Event::Cmap::/, '')} " +
      "address=#{address} pool=0x#{pool.object_id}>"
end