Current section
Files
Jump to
Current section
Files
lib/cmdc/application.ex
defmodule CMDC.Application do
@moduledoc "CMDC OTP 应用入口。"
use Application
@impl true
def start(_type, _args) do
CMDC.EventBus.init_buffer_tables()
CMDC.Checkpoint.Backend.ETS.ensure_table()
children = [
{Registry, keys: :duplicate, name: CMDC.EventBus.Registry},
{Registry, keys: :unique, name: CMDC.MCP.Registry},
{Registry, keys: :unique, name: CMDC.SessionRegistry},
# v0.5 AutoCheckpoint Plugin + 其他需要 fire-and-forget 异步任务的场景用,
# 避免 plugin hook 内同步阻塞 Agent gen_statem callback。
{Task.Supervisor, name: CMDC.AsyncTaskSupervisor}
]
opts = [strategy: :one_for_one, name: CMDC.Supervisor]
Supervisor.start_link(children, opts)
end
end