Sha256: 38d28ea3063213be37dd24d609877b15ca30d2fd7439ef0f6691d1e3377568cb
Contents?: true
Size: 1.2 KB
Versions: 11
Compression:
Stored size: 1.2 KB
Contents
# frozen_string_literal: true module Karafka # Karafka framework Cli class Cli < Thor # Server Karafka Cli action class Server < Base desc 'Start the Karafka server (short-cut alias: "s")' option aliases: 's' option :consumer_groups, type: :array, default: nil, aliases: :g # Start the Karafka server def call # Print our banner and info in the dev mode print_marketing_info if Karafka::App.env.development? Contracts::ServerCliOptions.new.validate!(cli.options) # We assign active topics on a server level, as only server is expected to listen on # part of the topics Karafka::Server.consumer_groups = cli.options[:consumer_groups] Karafka::Server.run end private # Prints marketing info def print_marketing_info Karafka.logger.info Info::BANNER if Karafka.pro? Karafka.logger.info( "\033[0;32mThank you for investing in the Karafka Pro subscription!\033[0m\n" ) else Karafka.logger.info( "\033[0;31mYou like Karafka? Please consider getting a Pro subscription!\033[0m\n" ) end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems