erlang

OTP GenServer (REQUIRED)

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "erlang" with this command: npx skills add poletron/custom-rules/poletron-custom-rules-erlang

Critical Patterns

OTP GenServer (REQUIRED)

-module(counter). -behaviour(gen_server). -export([start_link/0, increment/0, get/0]). -export([init/1, handle_call/3, handle_cast/2]).

start_link() -> gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).

init([]) -> {ok, 0}.

handle_call(get, _From, State) -> {reply, State, State}.

handle_cast(increment, State) -> {noreply, State + 1}.

Supervisor (REQUIRED)

-module(my_sup). -behaviour(supervisor). -export([start_link/0, init/1]).

start_link() -> supervisor:start_link({local, ?MODULE}, ?MODULE, []).

init([]) -> SupFlags = #{strategy => one_for_one, intensity => 5, period => 10}, Children = [ #{id => worker, start => {my_worker, start_link, []}} ], {ok, {SupFlags, Children}}.

Decision Tree

Need request/response? → Use gen_server call Need fire-and-forget? → Use gen_server cast Need supervision? → Use supervisor behavior Need state machine? → Use gen_statem Need event handling? → Use gen_event

Commands

erl # Start REPL erlc module.erl # Compile rebar3 compile # Build project rebar3 shell # Interactive shell

Resources

  • Concurrent Programming: concurrent-programming.md

  • Fault Tolerance: fault-tolerance.md

  • OTP Patterns: otp-patterns.md

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

lancedb

No summary provided by upstream source.

Repository SourceNeeds Review
General

trpc

No summary provided by upstream source.

Repository SourceNeeds Review
General

git-flow

No summary provided by upstream source.

Repository SourceNeeds Review
General

javascript-mastery

No summary provided by upstream source.

Repository SourceNeeds Review