ExBreak v0.0.4 ExBreak.Registry View Source

A registry of all running breakers

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Find a breaker, and return an error if it does not exist.

Look up a breaker, and create one if it does not exist.

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

find_breaker(key) View Source
find_breaker(function()) :: {:ok, pid()} | :error

Find a breaker, and return an error if it does not exist.

Link to this function

get_breaker(key) View Source
get_breaker(function()) :: {:ok, pid()} | {:error, any()}

Look up a breaker, and create one if it does not exist.

TODO: get_breaker/1 is a potential bottleneck, because it's the same GenServer call where we lookup all breakers. An ETS table isn't an option right now because we need get-or-create functionality.