rihanna v0.5.2 Rihanna.Config

Global configuration for Rihanna.

Sensible defaults have been chosen for you but if you want, you can optionally override any of these values in your local configuration.

For example, to change the table name for jobs:

config :rihanna, jobs_table_name: "awesome_jobs"

Link to this section Summary

Functions

Rihanna logs nothing by default

The maximum number of simultaneously executing workers for a dispatcher

How often the dispatcher should poll the database for new jobs (in milliseconds)

The table name to use for Rihanna jobs

In Postgres, advisory locks are scoped to a classid

Link to this section Functions

Rihanna logs nothing by default.

By configuring Rihanna with debug: true and setting Logger’s log level to :debug, you can get much more information about what it is doing during operation to troubleshoot issues.

Example

config :rihanna, debug: true
Link to this function dispatcher_max_concurrency()

The maximum number of simultaneously executing workers for a dispatcher.

50 is chosen as a sensible default. Tuning this might increase or decrease your throughput depending on a lot of factors including database churn and how many other dispatchers you are running.

Example

config :rihanna, dispatcher_max_concurrency: 25
Link to this function dispatcher_poll_interval()

How often the dispatcher should poll the database for new jobs (in milliseconds).

Default is 100.

Note that that actual poll interval in practice will be close to but not exactly this number of milliseconds for two reasons:

  1. A small amount of processing time for dispatching jobs is not included and will be added to the poll interval.
  2. A small, random amount of jitter is added to prevent multiple dispatchers started simultaneously from hitting the database at the same time.

Example

config :rihanna, dispatcher_poll_interval: :timer.seconds(1)
Link to this function jobs_table_name()

The table name to use for Rihanna jobs.

Link to this function pg_advisory_lock_class_id()

In Postgres, advisory locks are scoped to a classid.

Here we use a random classid to prevent potential collisions with other users of the advisory locking system.

In the unimaginably unlucky scenario that this conflicts with a lock classid that is already being used on your system, you can change the classid that Rihanna uses here.

Example

config :rihanna, pg_advisory_lock_class_id: 42