https://github.com/pertsevds/named_supervised_server
NamedSupervisedServer is a GenServer + start_link/1 behavior. By default, it registers name __MODULE__, but you can also supply a different name.
https://github.com/pertsevds/named_supervised_server
elixir
Last synced: 4 months ago
JSON representation
NamedSupervisedServer is a GenServer + start_link/1 behavior. By default, it registers name __MODULE__, but you can also supply a different name.
- Host: GitHub
- URL: https://github.com/pertsevds/named_supervised_server
- Owner: pertsevds
- License: apache-2.0
- Created: 2023-10-03T05:49:16.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-12T07:36:36.000Z (about 1 year ago)
- Last Synced: 2025-09-18T21:43:23.552Z (9 months ago)
- Topics: elixir
- Language: Elixir
- Homepage:
- Size: 38.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NamedSupervisedServer
[](https://github.com/pertsevds/named_supervised_server/actions/workflows/ci.yml)
[](https://hex.pm/packages/named_supervised_server)
[](https://hex.pm/packages/named_supervised_server)
[](https://hexdocs.pm/named_supervised_server)
[](https://hex.pm/packages/named_supervised_server)
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:
```elixir
def deps do
[
{:named_supervised_server, "~> 0.1"}
]
end
```
## Usage Examples and Documentation
For detailed usage examples and complete documentation, see: