Class: Asynq::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/asynq.rb

Overview

Asynq provides a lightweight, Ractor-safe Sidekiq client for pushing jobs from any arbitrary Ruby process.

Relying on the defaults is simple:

Asynq::Client.new

Use REDIS_URL to customize the Redis location. More flexible:

c = Asynq::Config.new(db: 0, port: 6379, read_timeout: 3).new_client

Instance Method Summary collapse

Constructor Details

#initialize(url: ENV["REDIS_URL"]) ⇒ Config

Returns a new instance of Config.



22
23
24
# File 'lib/asynq.rb', line 22

def initialize(url: ENV["REDIS_URL"], **)
  @cfg = RedisClient.config(url:, **)
end

Instance Method Details

#new_clientObject



26
27
28
# File 'lib/asynq.rb', line 26

def new_client
  Asynq::Client.new(@cfg.new_client)
end