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

Inherits:
BaseController show all
Defined in:
lib/karafka/web/pro/ui/controllers/consumers/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 Attribute Summary

Attributes inherited from Ui::Controllers::BaseController

#params, #session

Instance Method Summary collapse

Methods inherited from Ui::Controllers::BaseController

#cache, #initialize

Methods included from Ui::Controllers::Requests::Hookable

included, #run_after_hooks, #run_before_hooks

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)


60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/karafka/web/pro/ui/controllers/consumers/commanding_controller.rb', line 60

def quiet(process_id)
  features.commanding!

  request(
    Commanding::Commands::Consumers::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



92
93
94
95
96
97
98
99
100
101
# File 'lib/karafka/web/pro/ui/controllers/consumers/commanding_controller.rb', line 92

def quiet_all
  features.commanding!

  broadcast_request(Commanding::Commands::Consumers::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)


77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/karafka/web/pro/ui/controllers/consumers/commanding_controller.rb', line 77

def stop(process_id)
  features.commanding!

  request(
    Commanding::Commands::Consumers::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



104
105
106
107
108
109
110
111
112
113
# File 'lib/karafka/web/pro/ui/controllers/consumers/commanding_controller.rb', line 104

def stop_all
  features.commanding!

  broadcast_request(Commanding::Commands::Consumers::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)


43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/karafka/web/pro/ui/controllers/consumers/commanding_controller.rb', line 43

def trace(process_id)
  features.commanding!

  request(
    Commanding::Commands::Consumers::Trace,
    process_id
  )

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