Ankusa (ankusa v0.7.0)

Copy Markdown View Source

A loosely coupled, high-throughput webhook ingestion framework.

Core invariant

Never return 2xx until the hook is durably stored. The edge acks only after the group-commit batcher's store commit returns.

Layers (all pluggable behaviours)

Every process is instance-scoped through Ankusa.Registry, so two independent instances can run in one VM. Read-mostly config lives in :persistent_term.

Summary

Functions

Fetch the instance config.

Fetch the instance config, or :error when the instance has none (it never started).

Store the instance config in :persistent_term for read-mostly access.

Register/lookup name for an instance-scoped process.

Look up the running pid for an instance-scoped process, if any.

Functions

config(instance \\ :default)

@spec config(atom()) :: Ankusa.Config.t()

Fetch the instance config.

fetch_config(instance)

@spec fetch_config(atom()) :: {:ok, Ankusa.Config.t()} | :error

Fetch the instance config, or :error when the instance has none (it never started).

put_config(config)

@spec put_config(Ankusa.Config.t()) :: :ok

Store the instance config in :persistent_term for read-mostly access.

via(instance, key)

@spec via(atom(), term()) :: {:via, Registry, {module(), {atom(), term()}}}

Register/lookup name for an instance-scoped process.

whereis(instance, key)

@spec whereis(atom(), term()) :: pid() | nil

Look up the running pid for an instance-scoped process, if any.