LemonChannels.Application (lemon_channels v0.1.0)

View Source

OTP application and adapter lifecycle for LemonChannels.

Starts the plugin registry, outbox and dispatcher, then any adapters declared in config. Adapters can also be started, restarted and stopped at runtime with register_and_start_adapter/2, start_adapter/2 and stop_adapter/1 — the entrypoints a LemonChannels.Plugin author uses to bring an adapter online.

Summary

Functions

Register and start a channel adapter.

Start an adapter under the AdapterSupervisor.

Stop an adapter.

Functions

register_and_start_adapter(adapter_module, opts \\ [])

@spec register_and_start_adapter(
  module(),
  keyword()
) :: :ok | {:error, term()}

Register and start a channel adapter.

This function:

  1. Registers the adapter plugin with the Registry
  2. Starts the adapter's child_spec under the AdapterSupervisor

start_adapter(adapter_module, opts \\ [])

@spec start_adapter(
  module(),
  keyword()
) :: :ok | {:error, term()}

Start an adapter under the AdapterSupervisor.

stop_adapter(adapter_module)

@spec stop_adapter(module()) :: :ok | {:error, term()}

Stop an adapter.