ETS-based session registry for TDLib sessions.
Stores per-session metadata (pids, config, encryption keys) in a public ETS table with read concurrency enabled. Write operations go through the GenServer to ensure serialization.
Started automatically by Sexy.TDL — not called directly.
Stored fields
:name— session identifier:config— TDLib configuration (SetTdlibParametersstruct):supervisor_pid— Riser supervisor pid:backend_pid— Backend GenServer pid:handler_pid— Handler GenServer pid:app_pid— target process for events:encryption_key— database encryption key
Worker discovery
Client workers (Sorter, Updater, Sender, etc.) register via Sexy.TDL.Workers
(Elixir Registry). Use register_worker/2, get_worker/2, list_workers/1
for discovery. Workers auto-unregister when they die — no stale PIDs.
Summary
Functions
Returns a specification to start this module under a supervisor.
Look up a worker PID by session and role. Returns nil if not found or dead.
Callback implementation for GenServer.init/1.
List all registered workers for a session as [{role, pid}].
Register the calling process as a worker for the given session.
Types
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec drop(String.t()) :: true
Look up a worker PID by session and role. Returns nil if not found or dead.
Callback implementation for GenServer.init/1.
List all registered workers for a session as [{role, pid}].
Register the calling process as a worker for the given session.
# In your worker's init/1:
Sexy.TDL.Registry.register_worker(session_name, :sorter)