Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 1.04 KB

README.md

File metadata and controls

40 lines (29 loc) · 1.04 KB

Ticker

Build Status

Timer to schedule jobs in small intervals.

Installation

The package can be installed as:

  1. Add ticker to your list of dependencies in mix.exs:
```elixir
def deps do
  [{:ticker, "~> 0.0.1"}]
end
```
  1. Ensure ticker is started before your application:
```elixir
def application do
  [applications: [:ticker]]
end
```
  1. Add ticker to your supervised worker list
Module is the module you want to call.
Function is the function on the module you want to call.
Interval is the interval in milliseconds that you want this function repeatedly called.
This example is every 30 seconds.

```elixir
children = [
  worker(Ticker, [%{module: SomeWorker, function: :work, interval: 30_000}])
]
opts = [strategy: :one_for_one, name: MyApp.Supervisor]
Supervisor.start_link(children, opts)
```