Class: Zizq::WorkerConfiguration

Inherits:
Struct
  • Object
show all
Defined in:
lib/zizq/worker_configuration.rb

Overview

Defaults for ‘Zizq::Worker` instances. Accessed via `Zizq.configuration.worker` and typically populated inside an application’s ‘Zizq.configure` block:

Zizq.configure do |c|
  c.url = "https://..."
  c.worker.queues = ["emails", "webhooks"]
  c.worker.thread_count = 1
  c.worker.fiber_count = 25
end

Every field defaults to ‘nil`, meaning “use the Worker’s own hardcoded default.” Anything explicitly passed to ‘Worker.new` —or set via CLI flag / env var when launching `zizq-worker` —overrides whatever is set here.

See ‘Zizq::Worker#initialize` for the full resolution order (explicit kwarg → Zizq.configuration.worker → `Worker::DEFAULT_*`).

Fields:

  • ‘queues` — Queues to consume. `[]` means all queues.

  • ‘thread_count` — Number of worker threads.

  • ‘fiber_count` — Number of fibers per worker thread.

  • ‘prefetch` — Server-side prefetch limit. Defaults to `2 * threads * fibers`.

  • ‘retry_min_wait` — Minimum reconnect backoff in seconds.

  • ‘retry_max_wait` — Maximum reconnect backoff in seconds.

  • ‘retry_multiplier` — Multiplicative backoff factor between reconnect attempts.

Instance Attribute Summary collapse

Instance Attribute Details

#fiber_countObject

Returns the value of attribute fiber_count

Returns:

  • (Object)

    the current value of fiber_count



38
39
40
# File 'lib/zizq/worker_configuration.rb', line 38

def fiber_count
  @fiber_count
end

#prefetchObject

Returns the value of attribute prefetch

Returns:

  • (Object)

    the current value of prefetch



38
39
40
# File 'lib/zizq/worker_configuration.rb', line 38

def prefetch
  @prefetch
end

#queuesObject

Returns the value of attribute queues

Returns:

  • (Object)

    the current value of queues



38
39
40
# File 'lib/zizq/worker_configuration.rb', line 38

def queues
  @queues
end

#retry_max_waitObject

Returns the value of attribute retry_max_wait

Returns:

  • (Object)

    the current value of retry_max_wait



38
39
40
# File 'lib/zizq/worker_configuration.rb', line 38

def retry_max_wait
  @retry_max_wait
end

#retry_min_waitObject

Returns the value of attribute retry_min_wait

Returns:

  • (Object)

    the current value of retry_min_wait



38
39
40
# File 'lib/zizq/worker_configuration.rb', line 38

def retry_min_wait
  @retry_min_wait
end

#retry_multiplierObject

Returns the value of attribute retry_multiplier

Returns:

  • (Object)

    the current value of retry_multiplier



38
39
40
# File 'lib/zizq/worker_configuration.rb', line 38

def retry_multiplier
  @retry_multiplier
end

#thread_countObject

Returns the value of attribute thread_count

Returns:

  • (Object)

    the current value of thread_count



38
39
40
# File 'lib/zizq/worker_configuration.rb', line 38

def thread_count
  @thread_count
end