Sha256: 439b63fe2f6fb684e697b86d8ba760e7f6eb18ddfba630bcdf2cae23bd5ec12c

Contents?: true

Size: 998 Bytes

Versions: 3

Compression:

Stored size: 998 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', __FILE__))
        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

3 entries across 3 versions & 1 rubygems

Version Path
karafka-sidekiq-backend-1.2.0.beta3 lib/karafka-sidekiq-backend.rb
karafka-sidekiq-backend-1.2.0.beta2 lib/karafka-sidekiq-backend.rb
karafka-sidekiq-backend-1.2.0.beta1 lib/karafka-sidekiq-backend.rb