Class: Karafka::Web::Pro::Ui::Controllers::CommandingController

Inherits:
BaseController show all
Defined in:
lib/karafka/web/pro/ui/controllers/commanding_controller.rb

Overview

Controller responsible for handling requests that should trigger some action on the consumers.

Constant Summary

Constants inherited from Ui::Controllers::BaseController

Ui::Controllers::BaseController::Models

Instance Method Summary collapse

Methods inherited from Ui::Controllers::BaseController

#initialize

Constructor Details

This class inherits a constructor from Karafka::Web::Ui::Controllers::BaseController

Instance Method Details

#quiet(process_id) ⇒ Object

Dispatches the quiet request to a given process

Parameters:

  • process_id (String)


37
38
39
40
41
42
43
44
# File 'lib/karafka/web/pro/ui/controllers/commanding_controller.rb', line 37

def quiet(process_id)
  command(:quiet, process_id)

  redirect(
    :back,
    success: dispatched_to_one(:quiet, process_id)
  )
end

#quiet_allObject

Dispatches the quiet request that should trigger on all consumers



59
60
61
62
63
64
65
66
# File 'lib/karafka/web/pro/ui/controllers/commanding_controller.rb', line 59

def quiet_all
  command(:quiet, '*')

  redirect(
    :back,
    success: dispatched_to_all(:quiet)
  )
end

#stop(process_id) ⇒ Object

Dispatches the stop request to a given process

Parameters:

  • process_id (String)


49
50
51
52
53
54
55
56
# File 'lib/karafka/web/pro/ui/controllers/commanding_controller.rb', line 49

def stop(process_id)
  command(:stop, process_id)

  redirect(
    :back,
    success: dispatched_to_one(:stop, process_id)
  )
end

#stop_allObject

Dispatches the stop request that should trigger on all consumers



69
70
71
72
73
74
75
76
# File 'lib/karafka/web/pro/ui/controllers/commanding_controller.rb', line 69

def stop_all
  command(:stop, '*')

  redirect(
    :back,
    success: dispatched_to_all(:stop)
  )
end

#trace(process_id) ⇒ Object

Dispatches the trace request to a given process

Parameters:

  • process_id (String)


25
26
27
28
29
30
31
32
# File 'lib/karafka/web/pro/ui/controllers/commanding_controller.rb', line 25

def trace(process_id)
  command(:trace, process_id)

  redirect(
    :back,
    success: dispatched_to_one(:trace, process_id)
  )
end