Sha256: 648d12db9c56f285411f416d4fb7af76284f0031964252b8a7e68022383f5ac5
Contents?: true
Size: 1005 Bytes
Versions: 19
Compression:
Stored size: 1005 Bytes
Contents
# frozen_string_literal: true module Sbmt module KafkaConsumer class Server < Karafka::Server class << self # original klass tries to validate karafka-specific server cli-options which we override # see Karafka::Server for details def run Karafka::Server.listeners = [] Karafka::Server.workers = [] process.on_sigint { Karafka::Server.stop } process.on_sigquit { Karafka::Server.stop } process.on_sigterm { Karafka::Server.stop } process.on_sigtstp { Karafka::Server.quiet } process.supervise $stdout.puts "Starting server" Karafka::Server.start sleep(0.1) until Karafka::App.terminated? # rubocop:disable Lint/RescueException rescue Exception => e $stdout.puts "Cannot start server: #{e.message}" # rubocop:enable Lint/RescueException Karafka::Server.stop raise e end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems