Class: SidekiqTamer::Mongo::ServerOperation
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
#add_job, #is_consumed_by?, #jobs
Constructor Details
#initialize(host, port, operation) ⇒ ServerOperation
Returns a new instance of ServerOperation.
Instance Attribute Details
#operation ⇒ Object
Returns the value of attribute operation.
24
25
26
|
# File 'lib/sidekiq_tamer/mongo/server_operation.rb', line 24
def operation
@operation
end
|
#server ⇒ Object
Returns the value of attribute server.
24
25
26
|
# File 'lib/sidekiq_tamer/mongo/server_operation.rb', line 24
def server
@server
end
|
Class Method Details
.clear_server_operations ⇒ Object
16
17
18
|
# File 'lib/sidekiq_tamer/mongo/server_operation.rb', line 16
def self.clear_server_operations
@server_operations = {}
end
|
.server_operation_for(host, port, operation) ⇒ Object
10
11
12
13
14
|
# File 'lib/sidekiq_tamer/mongo/server_operation.rb', line 10
def self.server_operation_for(host, port, operation)
key = "#{host}:#{port}:#{operation}"
server_operations[key] ||= ServerOperation.new(host, port, operation)
server_operations[key]
end
|
.server_operations ⇒ Object
20
21
22
|
# File 'lib/sidekiq_tamer/mongo/server_operation.rb', line 20
def self.server_operations
@server_operations ||= {}
end
|
Instance Method Details
#is_healthy? ⇒ Boolean
35
36
37
|
# File 'lib/sidekiq_tamer/mongo/server_operation.rb', line 35
def is_healthy?
server.is_operation_safe?(@operation)
end
|
#name ⇒ Object
31
32
33
|
# File 'lib/sidekiq_tamer/mongo/server_operation.rb', line 31
def name
"MongoDB cluster #{operation}"
end
|