Class: CopyTunerClient::ProcessGuard
- Inherits:
-
Object
- Object
- CopyTunerClient::ProcessGuard
- Defined in:
- lib/copy_tuner_client/process_guard.rb
Overview
Starts the poller from a worker process, or register hooks for a spawner process (such as in Unicorn or Passenger). Also registers hooks for exiting processes and completing background jobs. Applications using the client will not need to interact with this class directly.
Instance Method Summary collapse
-
#initialize(cache, poller, options) ⇒ ProcessGuard
constructor
A new instance of ProcessGuard.
-
#start ⇒ Object
Starts the poller or registers hooks.
Constructor Details
#initialize(cache, poller, options) ⇒ ProcessGuard
Returns a new instance of ProcessGuard.
9 10 11 12 13 |
# File 'lib/copy_tuner_client/process_guard.rb', line 9 def initialize(cache, poller, ) @cache = cache @poller = poller @logger = [:logger] end |
Instance Method Details
#start ⇒ Object
Starts the poller or registers hooks
16 17 18 19 20 21 22 23 |
# File 'lib/copy_tuner_client/process_guard.rb', line 16 def start if spawner? register_spawn_hooks else register_exit_hooks start_polling end end |