类: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 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
创建定期执行程序。
44 45 46 47 48 49 |
# File 'lib/ Mongo/ 集群/ periodic_executor.rb', line 44 def 初始化(executors, = {}) @thread = nil @executors = executors @stop_semaphore = 信号量.new @options = end |
实例属性详细信息
# options ⇒对象(只读)
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
51 52 53 |
# File 'lib/ Mongo/ 集群/ periodic_executor.rb', line 51 def @options end |
实例方法详细信息
# do_work ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
55 56 57 58 |
# File 'lib/ Mongo/ 集群/ periodic_executor.rb', line 55 def do_work 执行 @stop_semaphore.wait(FREQUENCY) end |
#执行⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
在每个收割机上trigger执行调用。
83 84 85 86 |
# File 'lib/ Mongo/ 集群/ periodic_executor.rb', line 83 def 执行 @executors.每(和:execute) true end |
# flush ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
执行所有待处理的操作。
96 97 98 99 |
# File 'lib/ Mongo/ 集群/ periodic_executor.rb', line 96 def 刷新 @executors.每(和:flush) true end |
# pre_stop ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
60 61 62 |
# File 'lib/ Mongo/ 集群/ periodic_executor.rb', line 60 def pre_stop @stop_semaphore.信号 end |
# stop (final = false) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
64 65 66 67 68 69 70 71 72 73 |
# File 'lib/ Mongo/ 集群/ periodic_executor.rb', line 64 def 请停止(final = false) 超 开始 刷新 救援 StandardError end true end |