quantum-elixir / quantum-core

:watch: Cron-like job scheduler for Elixir
https://hexdocs.pm/quantum/
Apache License 2.0
2.3k stars 147 forks source link

What is the recommended way to supervise Quantum for Elixir 1.11+? #474

Closed thbar closed 3 years ago

thbar commented 3 years ago

Hello! The current readme gives:

defmodule Acme.Application do
  use Application

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

    children = [
      # This is the new line
      Acme.Scheduler
    ]

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

But as mentioned here (https://hexdocs.pm/elixir/1.10.4/Supervisor.Spec.html):

(Supervisor.Spec) This module is deprecated. Use the new child specifications outlined in the Supervisor module instead.

The Supervisor module is documented at https://hexdocs.pm/elixir/master/Supervisor.html, and I will follow that.

Are there caveats to switching to the new Supervisor in the case of Quantum?

Thanks!

maennchen commented 3 years ago

@thbar The scheduler is compatible with the new scheduler specs.

The old way could be removed from the docs, a PR would be welcome.