Electric.Shapes.ConsumerRegistry (electric v1.2.4)
View SourceSummary
Functions
Calls many GenServers asynchronously with the same message and waits for their responses before returning.
Types
@type shape_handle() :: Electric.ShapeCacheBehaviour.shape_handle()
@type stack_id() :: Electric.stack_id()
@type t() :: %Electric.Shapes.ConsumerRegistry{ stack_id: stack_id(), table: :ets.table() }
Functions
@spec active_consumer_count(stack_id()) :: non_neg_integer()
Calls many GenServers asynchronously with the same message and waits for their responses before returning.
Returns :ok once all GenServers have responded or have died.
There is no timeout so if the GenServers do not respond or die, this function will block indefinitely.
@spec publish([shape_handle()], term(), t()) :: :ok
@spec register_consumer(shape_handle(), pid(), stack_id()) :: {:ok, non_neg_integer()}
@spec register_consumer(shape_handle(), pid(), t()) :: {:ok, non_neg_integer()}
@spec register_consumer(shape_handle(), pid(), :ets.table()) :: {:ok, non_neg_integer()}
@spec remove_consumer(shape_handle(), t()) :: :ok
@spec whereis(stack_ref(), shape_handle()) :: pid() | nil