LemonGateway.ThreadRegistry (lemon_gateway v0.1.0)

View Source

Process registry for ThreadWorker processes.

Wraps an Elixir Registry to provide unique-key registration and lookup for thread workers by their thread key.

Summary

Functions

Registers the calling process under the given thread key.

Looks up the PID of the thread worker for the given key, or returns nil.

Functions

child_spec(opts)

register(thread_key)

@spec register(term()) :: {:ok, pid()} | {:error, {:already_registered, pid()}}

Registers the calling process under the given thread key.

start_link(opts)

whereis(thread_key)

@spec whereis(term()) :: pid() | nil

Looks up the PID of the thread worker for the given key, or returns nil.