module Pallets

Constants

VERSION

Public Class Methods

backend() click to toggle source
# File lib/pallets.rb, line 35
def self.backend
  @backend ||= begin
    cls = Pallets::Util.constantize("Pallets::Backends::#{configuration.backend.capitalize}")
    cls.new(
      blocking_timeout: configuration.blocking_timeout,
      failed_job_lifespan: configuration.failed_job_lifespan,
      failed_job_max_count: configuration.failed_job_max_count,
      job_timeout: configuration.job_timeout,
      pool_size: configuration.pool_size,
      **configuration.backend_args
    )
  end
end
configuration() click to toggle source
# File lib/pallets.rb, line 27
def self.configuration
  @configuration ||= Configuration.new
end
configure() { |configuration| ... } click to toggle source
# File lib/pallets.rb, line 31
def self.configure
  yield configuration
end
logger() click to toggle source
# File lib/pallets.rb, line 60
def self.logger
  @logger ||= Pallets::Logger.new(STDOUT,
    level: Pallets::Logger::INFO,
    formatter: Pallets::Logger::Formatters::Pretty.new
  )
end
middleware() click to toggle source
# File lib/pallets.rb, line 56
def self.middleware
  @middleware ||= configuration.middleware
end
serializer() click to toggle source
# File lib/pallets.rb, line 49
def self.serializer
  @serializer ||= begin
    cls = Pallets::Util.constantize("Pallets::Serializers::#{configuration.serializer.capitalize}")
    cls.new
  end
end