Class: Resque::Cluster::Member
- Inherits:
-
Object
- Object
- Resque::Cluster::Member
- Defined in:
- lib/resque/cluster/member.rb
Overview
Member is a single member of a resque pool cluster
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#pool ⇒ Object
readonly
Returns the value of attribute pool.
Instance Method Summary collapse
- #check_for_worker_count_adjustment ⇒ Object
-
#initialize(started_pool) ⇒ Member
constructor
A new instance of Member.
- #perform ⇒ Object
- #unregister ⇒ Object
Constructor Details
#initialize(started_pool) ⇒ Member
Returns a new instance of Member.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/resque/cluster/member.rb', line 10 def initialize(started_pool) @pool = started_pool @config = Config.new(Cluster.config[:local_config_path], Cluster.config[:global_config_path]) if @config.verified? @config.log_warnings @worker_count_manager = initialize_gru else @config.log_errors @pool.quit end end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'lib/resque/cluster/member.rb', line 8 def config @config end |
#pool ⇒ Object (readonly)
Returns the value of attribute pool.
8 9 10 |
# File 'lib/resque/cluster/member.rb', line 8 def pool @pool end |
Instance Method Details
#check_for_worker_count_adjustment ⇒ Object
31 32 33 34 35 |
# File 'lib/resque/cluster/member.rb', line 31 def check_for_worker_count_adjustment return unless gru_is_inititalized? host_count_adjustment = @worker_count_manager.adjust_workers adjust_worker_counts(host_count_adjustment) if host_count_adjustment end |
#perform ⇒ Object
22 23 24 |
# File 'lib/resque/cluster/member.rb', line 22 def perform check_for_worker_count_adjustment end |
#unregister ⇒ Object
26 27 28 29 |
# File 'lib/resque/cluster/member.rb', line 26 def unregister remove_counts unqueue_all_workers end |