Sippet v0.6.2 Sippet.Transactions.Registry View Source
The transactions registry, where client and server transaction keys are associated to transaction processes.
Link to this section Summary
Functions
Returns all client or server keys associated with the given process
Looks up if a registered process exists to handle the given key
Registers the current process under the given client or server transaction key in the transactions registry
Starts the transactions registry
Takes a {:via, Registry, {registry, key}} tuple corresponding to this
registry for the given key
Link to this section Types
client_key()
View Source
client_key() :: Sippet.Transactions.Client.Key.t()
client_key() :: Sippet.Transactions.Client.Key.t()
server_key()
View Source
server_key() :: Sippet.Transactions.Server.Key.t()
server_key() :: Sippet.Transactions.Server.Key.t()
Link to this section Functions
aliases(pid)
View Source
aliases(pid()) :: [client_key() | server_key()]
aliases(pid()) :: [client_key() | server_key()]
Returns all client or server keys associated with the given process.
lookup(key)
View Source
lookup(client_key() | server_key()) :: pid() | nil
lookup(client_key() | server_key()) :: pid() | nil
Looks up if a registered process exists to handle the given key.
An empty list if there is no match.
register_alias(key)
View Source
register_alias(client_key() | server_key()) ::
{:ok, pid()} | {:error, {:already_registered, pid()}}
register_alias(client_key() | server_key()) :: {:ok, pid()} | {:error, {:already_registered, pid()}}
Registers the current process under the given client or server transaction key in the transactions registry.
By doing so, incoming requests or responses will be redirected to the current transaction process once they come. The registry is cleared once the process closes.
start_link() View Source
Starts the transactions registry.
The registry is partitioned according to the number of schedulers available.
via_tuple(key)
View Source
via_tuple(client_key() | server_key()) ::
{:via, Registry, {Sippet.Transactions.Registry, client_key() | server_key()}}
via_tuple(client_key() | server_key()) :: {:via, Registry, {Sippet.Transactions.Registry, client_key() | server_key()}}
Takes a {:via, Registry, {registry, key}} tuple corresponding to this
registry for the given key.