33 lines
688 B
Elixir
33 lines
688 B
Elixir
defmodule Oban.Pro.Application do
|
|
@moduledoc false
|
|
|
|
use Application
|
|
|
|
@handlers [
|
|
Oban.Pro.Batch,
|
|
Oban.Pro.Engines.Smart,
|
|
Oban.Pro.Migration,
|
|
Oban.Pro.Partition,
|
|
Oban.Pro.Relay,
|
|
Oban.Pro.Worker,
|
|
Oban.Pro.Workflow
|
|
]
|
|
|
|
@impl Application
|
|
def start(_type, _args) do
|
|
for handler <- @handlers, do: handler.on_start()
|
|
|
|
children = [
|
|
{Oban.Pro.Diagnostics, []},
|
|
{Oban.Pro.Refresher, []},
|
|
{Task.Supervisor, name: Oban.Pro.TaskSupervisor}
|
|
]
|
|
|
|
Supervisor.start_link(children, strategy: :one_for_one, name: __MODULE__)
|
|
end
|
|
|
|
@impl Application
|
|
def stop(_state) do
|
|
for handler <- @handlers, do: handler.on_stop()
|
|
end
|
|
end
|