SkillKit.Webhook.Supervisor (SkillKit v0.1.0)

Copy Markdown View Source

Supervision tree for the webhook adapter.

Starts SkillKit.Webhook.Registry, the configured Store backend (default SkillKit.Webhook.Store.Memory), SkillKit.Webhook.Idempotency, and the configured Inbox backend (default SkillKit.Webhook.Inbox.Memory).

Named by default as SkillKit.Webhook so the facade can default its supervisor reference to the module name.

Summary

Functions

Returns a specification to start this module under a supervisor.

Derives the Idempotency process name for a given supervisor name.

Derives the Inbox process name for a given supervisor name.

Returns the {inbox_module, inbox_name} tuple for the configured inbox, as recorded during supervisor init. Used by the Plug to call Inbox.put/2 without knowing the impl module ahead of time.

Derives the Registry process name for a given supervisor name.

Derives the Store process name for a given supervisor name.

Returns the {store_module, store_name} tuple for the configured store, as recorded during supervisor init. The Webhook facade reads this so every register/get/list/unregister call lands on the configured store, not the default Store.Memory.

Types

opt()

@type opt() ::
  {:name, atom()}
  | {:store, {module(), keyword()}}
  | {:inbox, {module(), keyword()}}

Functions

child_spec(init_arg)

@spec child_spec(keyword()) :: Supervisor.child_spec()

Returns a specification to start this module under a supervisor.

See Supervisor.

idempotency_name(supervisor)

@spec idempotency_name(atom()) :: atom()

Derives the Idempotency process name for a given supervisor name.

inbox_name(supervisor)

@spec inbox_name(atom()) :: atom()

Derives the Inbox process name for a given supervisor name.

inbox_ref(supervisor)

@spec inbox_ref(atom()) :: {module(), atom()}

Returns the {inbox_module, inbox_name} tuple for the configured inbox, as recorded during supervisor init. Used by the Plug to call Inbox.put/2 without knowing the impl module ahead of time.

registry_name(supervisor)

@spec registry_name(atom()) :: atom()

Derives the Registry process name for a given supervisor name.

start_link(opts \\ [])

@spec start_link([opt()]) :: Supervisor.on_start()

store_name(supervisor)

@spec store_name(atom()) :: atom()

Derives the Store process name for a given supervisor name.

store_ref(supervisor)

@spec store_ref(atom()) :: {module(), atom()}

Returns the {store_module, store_name} tuple for the configured store, as recorded during supervisor init. The Webhook facade reads this so every register/get/list/unregister call lands on the configured store, not the default Store.Memory.