Module: Stellr::Utils::Shutdown

Included in:
Collections::Base, Server, Strategies::Base
Defined in:
lib/stellr/utils/shutdown.rb

Instance Method Summary collapse

Instance Method Details

#shutdown(mode = :abort) ⇒ Object

shutdown modes:

- :abort - stops immediately
- :graceful process all remaining queue entries and stop


8
9
10
11
# File 'lib/stellr/utils/shutdown.rb', line 8

def shutdown( mode = :abort )
  @shutdown = mode
  on_shutdown mode
end

#shutting_down?(mode = nil) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
16
17
18
19
# File 'lib/stellr/utils/shutdown.rb', line 13

def shutting_down?( mode = nil )
  if defined? @shutdown
    mode.nil? || @shutdown == mode
  else
    false
  end
end