Sha256: c2fad9e22bccbc8e40d3e5f24156c132ae4ebe1acb8832dee435675c35dde5ef
Contents?: true
Size: 1.08 KB
Versions: 26
Compression:
Stored size: 1.08 KB
Contents
# frozen_string_literal: true module Karafka module Instrumentation # Listener that sets a proc title with a nice descriptive value class ProctitleListener # Updates proc title to an initializing one # @param _event [Karafka::Core::Monitoring::Event] event details including payload def on_app_initializing(_event) setproctitle('initializing') end # Updates proc title to a running one # @param _event [Karafka::Core::Monitoring::Event] event details including payload def on_app_running(_event) setproctitle('running') end # Updates proc title to a stopping one # @param _event [Karafka::Core::Monitoring::Event] event details including payload def on_app_stopping(_event) setproctitle('stopping') end private # Sets a proper proc title with our constant prefix # @param status [String] any status we want to set def setproctitle(status) ::Process.setproctitle( "karafka #{Karafka::App.config.client_id} (#{status})" ) end end end end
Version data entries
26 entries across 26 versions & 1 rubygems