Class: Karafka::Status

Inherits:
Object
  • Object
show all
Defined in:
lib/karafka/status.rb

Overview

App status monitor

Constant Summary collapse

STATES =

Available states and their transitions.

{
  initializing: :initialize!,
  initialized: :initialized!,
  running: :run!,
  # will no longer pickup any work, but current work will be finished
  quieting: :quiet!,
  # no work is happening but we keep process with the assignments running
  quiet: :quieted!,
  # shutdown started
  stopping: :stop!,
  # all things are done and most of the things except critical are closed
  stopped: :stopped!,
  # immediately after this process exists
  terminated: :terminate!
}.freeze

Instance Method Summary collapse

Constructor Details

#initializeStatus

By default we are in the initializing state



29
30
31
# File 'lib/karafka/status.rb', line 29

def initialize
  initialize!
end

Instance Method Details

#reset!Object

Resets the status state This is used mostly in the integration suite



40
41
42
# File 'lib/karafka/status.rb', line 40

def reset!
  @status = :initializing
end

#to_sString

Returns stringified current app status.

Returns:

  • (String)

    stringified current app status



34
35
36
# File 'lib/karafka/status.rb', line 34

def to_s
  @status.to_s
end