Bandera.Notifications.Redis (bandera v0.1.0)

Copy Markdown

Redis PubSub cache-busting notifier (via Redix). Subscribes to a channel and, on a flag change published by ANOTHER node, busts the local cache entry for that flag. Self-published changes are ignored. Connection options are read at runtime from config :bandera, cache_bust_notifications: [redis: <Redix opts>].

Note: incoming change payloads come from a shared channel. The flag name is resolved with String.to_existing_atom/1, so notifications for flags this node has never referenced are ignored (and the atom table can't be exhausted by foreign publishers).

Summary

Functions

Returns a specification to start this module under a supervisor.

Starts the notifier GenServer, which opens its own Redis pub and sub connections.

Whether the PubSub subscription has been confirmed (useful in tests).

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()

Starts the notifier GenServer, which opens its own Redis pub and sub connections.

subscribed?()

@spec subscribed?() :: boolean()

Whether the PubSub subscription has been confirmed (useful in tests).