This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MyApp.Manager do | |
use GenServer | |
use Timex | |
import Ecto.Query, warn: false | |
@cache_pending_groups_expiry 60 * 5 | |
def start_link() do | |
Singleton.start_child(__MODULE__, %{supervised_workers: 0, groups: nil}, {MyApp.Manager, 1}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MyApp.Supervisor do | |
use Supervisor | |
def start_link do | |
Supervisor.start_link(__MODULE__, :ok, name: __MODULE__) | |
end | |
def init(:ok) do | |
children = [ | |
worker(Registry, [[name: Registry.MyApp, keys: :unique]]), |