Sha256: 5de44ae12385d384b0a0f02a125ecbe8a41c3dfc208260c9132b8433ff4aadf0

Contents?: true

Size: 1.72 KB

Versions: 3

Compression:

Stored size: 1.72 KB

Contents

# frozen_string_literal: true

# This Karafka component is a Pro component under a commercial license.
# This Karafka component is NOT licensed under LGPL.
#
# All of the commercial components are present in the lib/karafka/pro directory of this
# repository and their usage requires commercial license agreement.
#
# Karafka has also commercial-friendly license, commercial support and commercial components.
#
# By sending a pull request to the pro components, you are agreeing to transfer the copyright of
# your code to Maciej Mensfeld.

module Karafka
  module Web
    module Ui
      module Pro
        module Controllers
          # Controller for displaying consumers states and details about them
          class Consumers < Ui::Controllers::Base
            # Consumers list
            def index
              @current_state = Models::State.current!
              @counters = Models::Counters.new(@current_state)
              @processes, @next_page = Lib::PaginateArray.new.call(
                Models::Processes.active(@current_state),
                @params.current_page
              )

              respond
            end

            # @param process_id [String] id of the process we're interested in
            def jobs(process_id)
              current_state = Models::State.current!
              @process = Models::Process.find(current_state, process_id)

              respond
            end

            # @param process_id [String] id of the process we're interested in
            def subscriptions(process_id)
              current_state = Models::State.current!
              @process = Models::Process.find(current_state, process_id)

              respond
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
karafka-web-0.6.3 lib/karafka/web/ui/pro/controllers/consumers.rb
karafka-web-0.6.1 lib/karafka/web/ui/pro/controllers/consumers.rb
karafka-web-0.6.0 lib/karafka/web/ui/pro/controllers/consumers.rb