Class: Karafka::Web::Pro::Commanding::Commands::Consumers::Stop

Inherits:
Base
  • Object
show all
Defined in:
lib/karafka/web/pro/commanding/commands/consumers/stop.rb

Overview

Note:

Does not work in an embedded mode because we do not own the Ruby process.

Sends a signal to stop the process

Instance Attribute Summary

Attributes inherited from Base

#command

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Karafka::Web::Pro::Commanding::Commands::Base

Instance Method Details

#callObject

Performs the command if not in embedded mode



44
45
46
47
48
49
50
# File 'lib/karafka/web/pro/commanding/commands/consumers/stop.rb', line 44

def call
  return unless standalone?

  ::Process.kill("QUIT", ::Process.pid)

  result(status: "applied")
end