A lightweight behavior module that simplifies creating and supervising GenServers in Elixir applications.
NamedSupervisedServer eliminates boilerplate when creating GenServers by:
- Automatically registering processes with their module name (
__MODULE__
) - Supporting custom name registration via an optional
:name
parameter - Providing a standard
start_link/1
implementation that works with supervision trees - Maintaining full flexibility to override the default behavior when needed
- Automatic Name Registration: No need to manually specify process names for most use cases
- Supervisor Friendly: Designed to work seamlessly with Elixir's supervision trees
- PartitionSupervisor Compatible: Automatically appends partition numbers to process names and passes partition information to the initialization process
- Customizable: Override
start_link/1
for custom initialization behaviors
Add to your mix.exs
dependencies:
def deps do
[
{:named_supervised_server, "~> 0.1"}
]
end
For detailed usage examples and complete documentation, see: