Skip to content

NamedSupervisedServer is a GenServer + start_link/1 behavior. By default, it registers name __MODULE__, but you can also supply a different name.

License

Notifications You must be signed in to change notification settings

pertsevds/named_supervised_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NamedSupervisedServer

CI Hex.pm License Hex.pm Version Hex.pm Docs Hex.pm Downloads

A lightweight behavior module that simplifies creating and supervising GenServers in Elixir applications.

What it does

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

Features

  • 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

Installation

Add to your mix.exs dependencies:

def deps do
  [
    {:named_supervised_server, "~> 0.1"}
  ]
end

Usage Examples and Documentation

For detailed usage examples and complete documentation, see:

https://hexdocs.pm/named_supervised_server

About

NamedSupervisedServer is a GenServer + start_link/1 behavior. By default, it registers name __MODULE__, but you can also supply a different name.

Topics

Resources

License

Stars

Watchers

Forks

Languages