module Karafka

Karafka library

Karafka module namespace

Main module namespace

Constants

VERSION

Current Karafka version

Public Class Methods

boot_file() click to toggle source

@return [String] path to a default file that contains booting procedure etc @note By default it is a file called 'karafka.rb' but it can be specified as you wish if you

have Karafka that is merged into a Sinatra/Rails app and karafka.rb is taken.
It will be used for console/consumers/etc

@example Standard only-Karafka case

Karafka.boot_file #=> '/home/app_path/karafka.rb'

@example Non standard case

KARAFKA_BOOT_FILE='/home/app_path/app.rb'
Karafka.boot_file #=> '/home/app_path/app.rb'
# File lib/karafka.rb, line 61
def boot_file
  Pathname.new(ENV['KARAFKA_BOOT_FILE'] || File.join(Karafka.root, 'karafka.rb'))
end
core_root() click to toggle source

@return [String] path to Karafka gem root core

# File lib/karafka.rb, line 48
def core_root
  Pathname.new(File.expand_path('karafka', __dir__))
end
gem_root() click to toggle source

@return [String] root path of this gem

# File lib/karafka.rb, line 38
def gem_root
  Pathname.new(File.expand_path('..', __dir__))
end
logger() click to toggle source

@return [Logger] logger that we want to use. Will use ::Karafka::Logger by default

# File lib/karafka.rb, line 28
def logger
  @logger ||= App.config.logger
end
monitor() click to toggle source

@return [::Karafka::Monitor] monitor that we want to use

# File lib/karafka.rb, line 33
def monitor
  @monitor ||= App.config.monitor
end
root() click to toggle source

@return [String] Karafka app root path (user application path)

# File lib/karafka.rb, line 43
def root
  Pathname.new(ENV['KARAFKA_ROOT_DIR'] || File.dirname(ENV['BUNDLE_GEMFILE']))
end