Home

Awesome

Timelier

Hex Build Status Coverage Status

Timelier is a cron style scheduling application for Elixir. It will match a list of time 'patterns' against the current time and start any tasks associated with each matching pattern.

Installation

  1. Add timelier to your list of dependencies in mix.exs:

  def deps do
    [{:timelier, "~> 0.9.2"}]
  end
  1. To ensure timelier can successfully start tasks defined in your application (or its dependencies), add it as an included application:
def application do
  [included_applications: [:timelier]]
end

and append it's root supervisor to the list of children that your own top-level supervisor starts, e.g.

def start(_type, _args) do
  import Supervisor.Spec, warn: false

  # Define workers and child supervisors to be supervised
  children = [
    worker(YourApp.YourWorker, []),
    # Other children in your supervision tree...

    supervisor(Timelier.Supervisor, []) # Add timelier's top-level supervisor
  ]

  opts = [strategy: :one_for_one, name: YourApp.Supervisor]
  Supervisor.start_link(children, opts)
end

Configuration

There are three configuration variables that may be specified in the :timelier application:

Crontab entry format.

Each entry in the crontab list is a 2-tuple of {pattern, task}.