{"id":13507742,"url":"https://github.com/jbernardo95/cronex","last_synced_at":"2025-04-13T05:34:12.783Z","repository":{"id":49491582,"uuid":"71183128","full_name":"jbernardo95/cronex","owner":"jbernardo95","description":"A cron like system built in Elixir, that you can mount in your supervision tree","archived":false,"fork":false,"pushed_at":"2021-06-16T15:28:08.000Z","size":73,"stargazers_count":48,"open_issues_count":9,"forks_count":12,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T23:04:29.444Z","etag":null,"topics":["cron","cron-jobs","elixir"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/cronex","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jbernardo95.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-17T21:33:10.000Z","updated_at":"2024-04-17T17:43:25.000Z","dependencies_parsed_at":"2022-07-29T18:39:49.461Z","dependency_job_id":null,"html_url":"https://github.com/jbernardo95/cronex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbernardo95%2Fcronex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbernardo95%2Fcronex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbernardo95%2Fcronex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbernardo95%2Fcronex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jbernardo95","download_url":"https://codeload.github.com/jbernardo95/cronex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670520,"owners_count":21142896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cron","cron-jobs","elixir"],"created_at":"2024-08-01T02:00:38.459Z","updated_at":"2025-04-13T05:34:12.454Z","avatar_url":"https://github.com/jbernardo95.png","language":"Elixir","funding_links":[],"categories":["Date and Time"],"sub_categories":[],"readme":"# Cronex\n\n[![Travis Build](https://api.travis-ci.org/jbernardo95/cronex.svg?branch=master)](https://travis-ci.org/jbernardo95/cronex/)\n\nA cron like system, built in Elixir, that you can mount in your supervision tree.\n\nCronex's DSL for adding cron jobs is inspired by [whenever](https://github.com/javan/whenever) Ruby gem.\n\n## Installation\n\nAdd `cronex` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [{:cronex, \"~\u003e 0.4.0\"}]\nend\n```\n\nThen run `mix deps.get` to get the package.\n\n## Getting started\n\nCronex makes it really easy and intuitive to schedule cron like jobs.\n\nYou use the `Cronex.Scheduler` module to define a scheduler and add jobs to it.\n\nCronex will gather jobs from the scheduler you defined and will run them at the expected time.\n\n```elixir\n# Somewhere in your application define your scheduler\ndefmodule MyApp.Scheduler do\n  use Cronex.Scheduler\n\n  every :hour do\n    IO.puts \"Every hour job\"\n  end\n\n  every :day, at: \"10:00\" do\n    IO.puts \"Every day job at 10:00\"\n  end\nend\n\n# Start scheduler with start_link\nMyApp.Scheduler.start_link\n\n# Or add it to your supervision tree\ndefmodule MyApp.Supervisor do\n  use Supervisor\n\n  # ...\n\n  def init(_opts) do\n    children = [\n      # ...\n      supervisor(MyApp.Scheduler, [])\n      # ...\n    ]\n\n    supervise(children, ...)\n  end\n\n  # ...\nend\n```\n\nYou can define as much schedulers as you want.\n\n## Testing\n\nCronex comes with `Cronex.Test` module which provides helpers to test your cron jobs.\n\n```elixir\ndefmodule MyApp.SchedulerTest do\n  use ExUnit.Case\n  use Cronex.Test\n\n  test \"every hour job is defined in MyApp.Scheduler\" do\n    assert_job_every :hour, in: MyApp.Scheduler \n  end\n\n  test \"every day job at 10:00 is defined in MyApp.Scheduler\" do\n    assert_job_every :day, at: \"10:00\", in: MyApp.Scheduler \n  end\nend\n```\n\n## Documentation\n\nThe project documentation can be found [here](https://hexdocs.pm/cronex/api-reference.html).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/jbernardo95/cronex.\n\n## License\n\nCronex source code is licensed under the [MIT License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbernardo95%2Fcronex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbernardo95%2Fcronex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbernardo95%2Fcronex/lists"}