类:Mongo::Monitoring::Event::Cmap::PoolCleared

继承:
Base 显示全部
定义于:
lib/ Mongo/ 监控/ 事件/cmap/pool_cleared.rb

Overview

清除连接池时发布的事件。

由于:

  • 2.9.0

实例属性摘要折叠

实例方法摘要折叠

构造函数详情

#initialize (解决, service_id: nil, Interrupt_in_use_connections: nil) ="PoolCleared"

此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。

创建事件。

参数:

  • 地址 地址
  • service_id 对象 (默认为: nil

    服务 ID(如果有)。

  • Interrupt_in_use_connections ( true | false | nil ) (默认为: nil

    Interrupt_in_use_connections 标志(如果给出)。

由于:

  • 2.9.0



48
49
50
51
52
53
# File 'lib/ Mongo/ 监控/ 事件/cmap/pool_cleared.rb', line 48

def 初始化(地址, service_id: nil, Interrupt_in_use_connections: nil)
  @address = 地址
  @service_id = service_id
  @options = {}
  @options[:interrupt_in_use_connections] = Interrupt_in_use_connections
end

实例属性详细信息

#地址Mongo::Address (readonly)

返回地址池的连接将连接到的服务器的地址。

返回:

  • ( Mongo::Address )

    解决池的连接将连接到的服务器的解决。

由于:

  • 2.9.0



32
33
34
# File 'lib/ Mongo/ 监控/ 事件/cmap/pool_cleared.rb', line 32

def 地址
  @address
end

# options哈希(只读)

返回 options 选项。

返回:

  • (哈希)

    选项 选项

由于:

  • 2.9.0



38
39
40
# File 'lib/ Mongo/ 监控/ 事件/cmap/pool_cleared.rb', line 38

def 选项
  @options
end

# service_id =" nil |对象(只读)

返回 服务 ID(如果有)。

返回:

  • ( nil | Object )

    服务 ID(如果有)。

由于:

  • 2.9.0



35
36
37
# File 'lib/ Mongo/ 监控/ 事件/cmap/pool_cleared.rb', line 35

def service_id
  @service_id
end

实例方法详细信息

#摘要string

注意:

此方法是实验性的,可能会发生变化。

返回简洁而有用的事件摘要。

返回:

  • ( string )

    事件摘要的string 。

由于:

  • 2.9.0



63
64
65
# File 'lib/ Mongo/ 监控/ 事件/cmap/pool_cleared.rb', line 63

def 总结
  " #< #{ { self . class . name . sub ( / ^Mongo::Monitoring::Event::Cmap:: / , ' ' ) } 解决= #{ 解决 } > "
end