Class: ProcessWanker::DummyService
- Includes:
- Log
- Defined in:
- lib/service_classes/dummy_service.rb
Constant Summary
Constants included from Log
Log::DEBUG, Log::ERROR, Log::INFO, Log::WARN
Instance Attribute Summary
Attributes inherited from Service
#attempt_count, #config_node, #current_state, #dependencies, #ignore, #last_action_time, #last_fail_time, #last_transition_time, #params, #prev_state, #show_state, #stable, #suppress, #want_state, #want_state_mode
Class Method Summary collapse
Instance Method Summary collapse
-
#do_ping ⇒ Object
ping.
-
#do_start(attempt_count) ⇒ Object
start.
-
#do_stop(attempt_count) ⇒ Object
stop.
-
#initialize(iparams) ⇒ DummyService
constructor
A new instance of DummyService.
Methods included from Log
debug, error, info, log, set_level, warn
Methods inherited from Service
#check_action_delay, #extract_params, #group_name, #matches_single, #matches_spec, #name, #resolve_dependencies, #safe_do, #safe_do_ping, #safe_do_start, #safe_do_stop, #set_want_state, #tick, #validate_params
Constructor Details
#initialize(iparams) ⇒ DummyService
Returns a new instance of DummyService.
36 37 38 39 |
# File 'lib/service_classes/dummy_service.rb', line 36 def initialize(iparams) @state=(iparams[:initial_state] || :down).to_sym super(iparams) end |
Class Method Details
.nice_name ⇒ Object
26 27 28 |
# File 'lib/service_classes/dummy_service.rb', line 26 def self.nice_name "dummy_service" end |
Instance Method Details
#do_ping ⇒ Object
ping
return run state of process
71 72 73 |
# File 'lib/service_classes/dummy_service.rb', line 71 def do_ping @state end |
#do_start(attempt_count) ⇒ Object
start
47 48 49 50 |
# File 'lib/service_classes/dummy_service.rb', line 47 def do_start(attempt_count) debug("do_start #{self.name}") @state=:up end |
#do_stop(attempt_count) ⇒ Object
stop
58 59 60 61 |
# File 'lib/service_classes/dummy_service.rb', line 58 def do_stop(attempt_count) debug("do_stop #{self.name}") @state=:down end |