rihanna v0.5.2 Rihanna.Supervisor

The main supervisor for Rihanna.

Starts the Postgrex process necessary for enqueueing jobs, and also starts a dispatcher for processing them.

Setup

Add Rihanna.Supervisor to your supervision tree.

By adding it to your supervision tree it will automatically start running jobs when your app boots.

Rihanna requires a database configuration to be passed in under the postgrex key. This is passed through directly to Postgrex.

If you are already using Ecto you can avoid duplicating your DB config by pulling this out of your existing Repo using My.Repo.config().

# NOTE: In Phoenix you would find this inside `lib/my_app/application.ex`
children = [
  {Rihanna.Supervisor, [name: Rihanna.Supervisor, postgrex: My.Repo.config()]}
]

Link to this section Summary

Link to this section Functions

Link to this function start_link(config, opts \\ [])