类:Mongo::Cluster::PeriodicExecutor Private
Overview
此类是私有 API 的一部分。 应尽可能避免使用此类,因为它将来可能会被删除或更改。
定期在其执行程序上调用 #execute 的管理器。
常量摘要折叠
- FREQUENCY =
此常量是私有 API 的一部分。 应尽可能避免使用此常量,因为它将来可能会被删除或更改。
定期执行器执行的默认时间间隔。
5
Loggable中包含的常量
实例属性摘要折叠
- # options ⇒ 对象 只读 private
实例方法摘要折叠
- # do_work ⇒ 对象 private
-
#执行⇒ 对象
private
在每个收割机上trigger执行调用。
-
# flush ⇒ 对象
private
执行所有待处理的操作。
-
#initialize (executors, options = {}) ">PerioticExecutor
构造函数
private
创建定期执行程序。
- #pre_stop ⇒ Object private
- # stop (final = false) ⇒ 对象 private
包含在BackgroundThread中的方法
Loggable中包含的方法
#log_debug 、 #log_error 、 #log_ Fatal 、 #log_info 、 #log_warn 、 #logger
构造函数详情
#initialize (executors, options = {}) "> PerioticExecutor
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
创建定期执行程序。
47 48 49 50 51 52 |
# File 'lib/ Mongo/ 集群/ periodic_executor.rb', line 47 def 初始化(executors, = {}) @thread = nil @executors = executors @stop_semaphore = 信号量.new @options = end |
实例属性详细信息
# options ⇒对象(只读)
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
54 55 56 |
# File 'lib/ Mongo/ 集群/ periodic_executor.rb', line 54 def @options end |
实例方法详细信息
# do_work ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
58 59 60 61 |
# File 'lib/ Mongo/ 集群/ periodic_executor.rb', line 58 def do_work 执行 @stop_semaphore.wait(FREQUENCY) end |
#执行⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
在每个收割机上trigger执行调用。
86 87 88 89 |
# File 'lib/ Mongo/ 集群/ periodic_executor.rb', line 86 def 执行 @executors.每(和:execute) true end |
# flush ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
执行所有待处理的操作。
99 100 101 102 |
# File 'lib/ Mongo/ 集群/ periodic_executor.rb', line 99 def 刷新 @executors.每(和:flush) true end |
# pre_stop ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
63 64 65 |
# File 'lib/ Mongo/ 集群/ periodic_executor.rb', line 63 def pre_stop @stop_semaphore.信号 end |
# stop (final = false) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
67 68 69 70 71 72 73 74 75 76 |
# File 'lib/ Mongo/ 集群/ periodic_executor.rb', line 67 def 请停止(final = false) 超 开始 刷新 救援 end true end |