Sha256: 6701133a5b738e4be3be6e63dc2655581e818def2904a1d4705b8aabd39b4b89

Contents?: true

Size: 806 Bytes

Versions: 1

Compression:

Stored size: 806 Bytes

Contents

# frozen_string_literal: true

require_relative 'quiq/version'
require_relative 'quiq/config'
require_relative 'quiq/server'
require_relative 'quiq/client'
require 'async/redis'

module Quiq
  extend self

  def configuration
    Config.instance
  end

  def configure
    yield(configuration) if block_given?
  end

  def redis
    configuration.redis.client
  end

  def boot(options)
    configuration.parse_options(**options)

    # Load the workers source code
    path = configuration.path
    if File.directory?(path)
      Dir.glob(File.join(path, '*.rb')).each { |file| require file }
    else
      require path
    end

    Server.instance.run!
  end

  def queues
    configuration.queues
  end

  def current_task
    Async::Task.current
  end

  def logger
    configuration.logger
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
quiq-0.2.0 lib/quiq.rb