Providers as mishka_installer plugins — the half MishkaCmsCore.Mail.Provider and
MishkaCmsCore.Captcha.Provider share.
A provider is a module that listens on its kind's event and adds itself to the providers list
the event carries. use makes a module that plugin:
use MishkaCmsCore.ProviderRegistry, event: "mail:providers", priority: 10all/2, offered/2 and fetch/3 ask the event which providers are installed: every registered
module that implements the kind's behaviour, the first of each id. Stopping a provider's plugin in
the installer takes it out of the list. Nothing is cached: the event is asked each time.
An event whose plugins cannot run — one of them is not loaded, so Hook.call/3 answers its
cannot_run: option — cannot say which providers are installed: all/2 and offered/2 list
none, and fetch/3 answers {:error, :cannot_run} rather than {:error, :unknown_provider}.
Summary
Functions
Every provider registered on event that implements behaviour, the first of each id.
The offered provider registered on event under id; {:error, :cannot_run} when the event's
plugins cannot run, so whether it is installed cannot be told.
The providers of all/2 this installation offers: every one, unless its offered?/0 says not.
Functions
Every provider registered on event that implements behaviour, the first of each id.
@spec fetch(String.t(), module(), String.t() | nil) :: {:ok, module()} | {:error, :unknown_provider | :cannot_run}
The offered provider registered on event under id; {:error, :cannot_run} when the event's
plugins cannot run, so whether it is installed cannot be told.
The providers of all/2 this installation offers: every one, unless its offered?/0 says not.