Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ausimian/timelier
A cron-style scheduler application for Elixir.
https://github.com/ausimian/timelier
Last synced: 3 months ago
JSON representation
A cron-style scheduler application for Elixir.
- Host: GitHub
- URL: https://github.com/ausimian/timelier
- Owner: ausimian
- License: mit
- Created: 2017-01-07T05:42:21.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-22T03:27:14.000Z (over 7 years ago)
- Last Synced: 2024-10-03T09:20:03.926Z (4 months ago)
- Language: Elixir
- Homepage:
- Size: 30.3 KB
- Stars: 12
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - A cron-style scheduler for Elixir. (Date and Time)
- fucking-awesome-elixir - timelier - A cron-style scheduler for Elixir. (Date and Time)
- awesome-elixir - timelier - A cron-style scheduler for Elixir. (Date and Time)
README
# Timelier
[![Hex](https://img.shields.io/hexpm/v/timelier.svg)](https://hex.pm/packages/timelier) [![Build Status](https://travis-ci.org/ausimian/timelier.svg?branch=master)](https://travis-ci.org/ausimian/timelier) [![Coverage Status](https://coveralls.io/repos/github/ausimian/timelier/badge.svg?branch=master)](https://coveralls.io/github/ausimian/timelier?branch=master)
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`:
```elixir
def deps do
[{:timelier, "~> 0.9.2"}]
end
```2. To ensure `timelier` can successfully start tasks defined in your application (or
its dependencies), add it as an [included application](http://erlang.org/doc/design_principles/included_applications.html):```elixir
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.
```elixir
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
```
## ConfigurationThere are three configuration variables that may be specified in the `:timelier` application:
* `crontab`: The list of crontab entries - see below for a discussion of the format. If not
specified, defaults to the empty list.
* `timezone`: Either `:local` or `:utc`. This determines how the current time
is matched against the crontab entries. If not specified, defaults to `:local`
* `provider`: Allows the source of crontab configuration to be overridden. See the hex docs
for more information.### Crontab entry format.
Each entry in the crontab list is a 2-tuple of `{pattern, task}`.
* The pattern is a 5-tuple of the form `{minute, hour, day, day-of-week, month}`. Both wildcards
and alternates may be specified for each entry. See the hex docs for more detail.
* The task is a 3-tuple of {module, function, args} as would be passed to `Kernel.apply/3`.