Sha256: 2bc3be522d3860af11c1105c59e5330272f80ac2be9844fb9b4c236ef58addce

Contents?: true

Size: 1.49 KB

Versions: 1

Compression:

Stored size: 1.49 KB

Contents

require "pallets/version"

require 'pallets/backends/base'
require 'pallets/backends/redis'
require 'pallets/configuration'
require 'pallets/context'
require 'pallets/dsl/workflow'
require 'pallets/errors'
require 'pallets/graph'
require 'pallets/logger'
require 'pallets/manager'
require 'pallets/middleware/job_logger'
require 'pallets/middleware/stack'
require 'pallets/pool'
require 'pallets/scheduler'
require 'pallets/serializers/base'
require 'pallets/serializers/json'
require 'pallets/serializers/msgpack'
require 'pallets/task'
require 'pallets/util'
require 'pallets/worker'
require 'pallets/workflow'

require 'securerandom'

module Pallets
  def self.configuration
    @configuration ||= Configuration.new
  end

  def self.configure
    yield configuration
  end

  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,
        job_timeout: configuration.job_timeout,
        pool_size: configuration.pool_size,
        **configuration.backend_args
      )
    end
  end

  def self.serializer
    @serializer ||= begin
      cls = Pallets::Util.constantize("Pallets::Serializers::#{configuration.serializer.capitalize}")
      cls.new
    end
  end

  def self.middleware
    @middleware ||= configuration.middleware
  end

  def self.logger
    @logger ||= configuration.logger
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pallets-0.8.0 lib/pallets.rb