mailio_registry (mailio v0.2.0)

Process registry (via-compatible).

A tiny name registry backed by a public ETS table, usable as a {via, mailio_registry, Name} target for gen_server/gen_statem. Names are arbitrary terms (e.g. {writer, AccountId}, {imap_conn, AccountId}), which avoids minting atoms from binaries. The owning gen_server only holds the table; lookups are direct ETS reads for speed.

Summary

Functions

handle_call(Req, From, State)

handle_cast(Msg, State)

handle_info(Info, State)

init(_)

lookup(Name)

-spec lookup(term()) -> {ok, pid()} | {error, not_found}.

register_name(Name, Pid)

-spec register_name(term(), pid()) -> yes | no.

send(Name, Msg)

-spec send(term(), term()) -> pid().

start_link()

-spec start_link() -> {ok, pid()} | {error, term()}.

terminate(Reason, State)

unregister_name(Name)

-spec unregister_name(term()) -> ok.

whereis_name(Name)

-spec whereis_name(term()) -> pid() | undefined.