Incant.Service.RegistryServer (incant v0.1.0)

Copy Markdown

Supervised process for a central Incant service registry.

The server owns the runtime copy of %Incant.Service.Registry{} for a central Incant admin application. By default it loads from HOSTKIT_RPC_BINDINGS through Incant.Service.Registry.load/1, but tests and embedding apps may pass already decoded :bindings or a :path.

Summary

Functions

Returns a specification to start this module under a supervisor.

Fetches the first entry for a binding key.

Fetches the entry for a binding key and Incant service module.

Lists discovered entries.

Reloads bindings/descriptors/contracts and returns the new registry.

Refreshes the registry and lists its entries, retaining the current snapshot on failure.

Returns the current registry snapshot.

Starts a registry server.

Types

server()

@type server() :: GenServer.server()

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_entry(server \\ __MODULE__, key)

Fetches the first entry for a binding key.

get_entry(server, key, module)

Fetches the entry for a binding key and Incant service module.

list_entries(server \\ __MODULE__)

@spec list_entries(server()) :: [Incant.Service.Entry.t()]

Lists discovered entries.

refresh(server \\ __MODULE__)

@spec refresh(server()) :: {:ok, Incant.Service.Registry.t()} | {:error, term()}

Reloads bindings/descriptors/contracts and returns the new registry.

refresh_entries(server \\ __MODULE__)

@spec refresh_entries(server()) :: [Incant.Service.Entry.t()]

Refreshes the registry and lists its entries, retaining the current snapshot on failure.

registry(server \\ __MODULE__)

@spec registry(server()) :: Incant.Service.Registry.t()

Returns the current registry snapshot.

start_link(opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()

Starts a registry server.