Sippet v0.4.9 Sippet.Transactions.Registry

The transactions registry, where client and server transaction keys are associated to transaction processes.

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

Types

client_key()
server_key()

Functions

aliases(pid)
aliases(pid) :: [client_key | server_key]

Returns all client or server keys associated with the given process.

lookup(key)
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)
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()

Starts the transactions registry.

The registry is partitioned according to the number of schedulers available.

via_tuple(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.