Sha256: e9e88a3f6e330ef24017d9612474364b9b44d583471a73e4b95e975a5242dbc5

Contents?: true

Size: 994 Bytes

Versions: 2

Compression:

Stored size: 994 Bytes

Contents

# frozen_string_literal: true

# @note Active Support is already included since Karafka is using it directly so no need
#   to require it again in the gemspec, etc
%w[
  karafka
  sidekiq
  active_support/core_ext/class/subclasses
].each(&method(:require))

# Karafka framework namespace
module Karafka
  # Namespace for all the backends that process data
  module Backends
    # Sidekiq Karafka backend
    module Sidekiq
      class << self
        # @return [String] path to Karafka gem root core
        def core_root
          Pathname.new(File.expand_path('karafka', __dir__))
        end
      end
    end
  end
end

# Uses Karafka loader to load all the sources that this backend needs
Karafka::Loader.load!(Karafka::Backends::Sidekiq.core_root)
Karafka::AttributesMap.prepend(Karafka::Extensions::SidekiqAttributesMap)
# Register internal events for instrumentation
%w[
  backends.sidekiq.process
  backends.sidekiq.base_worker.perform
].each(&Karafka.monitor.method(:register_event))

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
karafka-sidekiq-backend-1.2.0 lib/karafka-sidekiq-backend.rb
karafka-sidekiq-backend-1.2.0.beta4 lib/karafka-sidekiq-backend.rb