Sha256: 596bd7efcc14d7642e8cabccd9daa3ed45dec7c044a75b596a5587519a102265

Contents?: true

Size: 958 Bytes

Versions: 7

Compression:

Stored size: 958 Bytes

Contents

# frozen_string_literal: true

require "private_attr"
require "sidekiq_publisher/version"
require "sidekiq_publisher/report_unpublished_count"
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

7 entries across 7 versions & 1 rubygems

Version Path
sidekiq_publisher-1.6.0 lib/sidekiq_publisher.rb
sidekiq_publisher-1.6.0.pre0 lib/sidekiq_publisher.rb
sidekiq_publisher-1.5.0 lib/sidekiq_publisher.rb
sidekiq_publisher-1.4.0 lib/sidekiq_publisher.rb
sidekiq_publisher-1.4.0.rc0 lib/sidekiq_publisher.rb
sidekiq_publisher-1.3.0 lib/sidekiq_publisher.rb
sidekiq_publisher-1.2.0 lib/sidekiq_publisher.rb