Sha256: 828c2f5580db9360eadfd2531b0dfb52c8327ffd70b385667d0b59a76b0b37a4

Contents?: true

Size: 905 Bytes

Versions: 8

Compression:

Stored size: 905 Bytes

Contents

# frozen_string_literal: true

require "private_attr"
require "sidekiq_publisher/version"
require "sidekiq_publisher/job"
require "sidekiq_publisher/worker"
require "sidekiq_publisher/publisher"
require "sidekiq_publisher/runner"
require "sidekiq_publisher/railtie" if defined?(Rails)

module SidekiqPublisher
  DEFAULT_BATCH_SIZE = 100
  DEFAULT_JOB_RETENTION_PERIOD = 1.day.freeze

  class << self
    attr_accessor :logger, :exception_reporter, :metrics_reporter
    attr_writer :batch_size, :job_retention_period

    def configure
      yield self
    end

    def batch_size
      @batch_size || DEFAULT_BATCH_SIZE
    end

    def job_retention_period
      @job_retention_period || DEFAULT_JOB_RETENTION_PERIOD
    end

    # For test purposes
    def reset!
      @batch_size = nil
      @job_retention_period = nil
      @exception_reporter = nil
      @metrics_reporter = nil
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sidekiq_publisher-1.1.0 lib/sidekiq_publisher.rb
sidekiq_publisher-1.0.0 lib/sidekiq_publisher.rb
sidekiq_publisher-0.3.3 lib/sidekiq_publisher.rb
sidekiq_publisher-0.3.2 lib/sidekiq_publisher.rb
sidekiq_publisher-0.3.1 lib/sidekiq_publisher.rb
sidekiq_publisher-0.3.0 lib/sidekiq_publisher.rb
sidekiq_publisher-0.2.1 lib/sidekiq_publisher.rb
sidekiq_publisher-0.2.0 lib/sidekiq_publisher.rb