Dispenser.SubscriptionManager (dispenser v0.1.0) View Source

SubscriptionManager handles monitoring and demonitoring subscribers

Link to this section Summary

Types

t()

The opaque internal state of the SubscriptionManager.

Functions

Stop monitoring the given subscriber.

Handle the down signal from a monitored subscriber.

Monitor the given pid using Process.monitor/1. Callers must handle the :DOWN message from this pid.

Get the number of currently monitored subscribers.

Link to this section Types

Specs

t()

The opaque internal state of the SubscriptionManager.

Link to this section Functions

Link to this function

demonitor(state, subscriber)

View Source

Specs

demonitor(t(), pid()) :: {:ok, t()} | {:error, :not_subscribed}

Stop monitoring the given subscriber.

Link to this function

down(state, subscriber, ref)

View Source

Specs

down(t(), pid(), reference()) ::
  {:ok, t()} | {:error, :wrong_ref} | {:error, :not_subscribed}

Handle the down signal from a monitored subscriber.

Link to this function

monitor(state, subscriber)

View Source

Specs

monitor(t(), pid()) :: t()

Monitor the given pid using Process.monitor/1. Callers must handle the :DOWN message from this pid.

Specs

new() :: t()

Specs

size(t()) :: non_neg_integer()

Get the number of currently monitored subscribers.