1- # 🌩 Nebulex Streams
1+ # Nebulex Streams 🌩
22> Real-time event streaming for Nebulex caches
33
44![ CI] ( https://github.com/elixir-nebulex/nebulex_streams/workflows/CI/badge.svg )
@@ -18,6 +18,8 @@ applications and real-time monitoring.
1818- 🎯 ** Event Filtering** - Subscribe to specific event types.
1919- 🌐 ** Distributed** - Built on Phoenix.PubSub for cluster-wide events.
2020- 📊 ** Telemetry** - Comprehensive observability with telemetry events.
21+ - 🔄 ** Built-in Invalidation** - Automatic cache invalidation for distributed
22+ consistency.
2123
2224## Installation
2325
@@ -31,6 +33,9 @@ def deps do
3133end
3234```
3335
36+ See the [ online documentation] ( https://hexdocs.pm/nebulex_streams )
37+ for more information.
38+
3439## Quick Start
3540
3641### 1. Define Your Cache
@@ -287,6 +292,27 @@ Nebulex Streams supports dynamic caches:
287292MyApp .Cache .subscribe (:my_dynamic_cache , [])
288293```
289294
295+ ## Automatic Cache Invalidation
296+
297+ For distributed cache scenarios, Nebulex Streams includes a built-in
298+ [ ` Nebulex.Streams.Invalidator ` ] ( https://hexdocs.pm/nebulex_streams/Nebulex.Streams.Invalidator.html )
299+ that automatically removes stale entries when they change on other nodes. This
300+ implements a "fail-safe" approach to cache consistency.
301+
302+ ``` elixir
303+ # Add to your supervision tree after the stream
304+ children = [
305+ MyApp .Cache ,
306+ {Nebulex .Streams , cache: MyApp .Cache },
307+ {Nebulex .Streams .Invalidator , cache: MyApp .Cache } # Watch for changes
308+ ]
309+
310+ Supervisor .start_link (children, strategy: :rest_for_one )
311+ ```
312+
313+ For detailed options and patterns, see the
314+ [ Invalidator documentation] ( https://hexdocs.pm/nebulex_streams/Nebulex.Streams.Invalidator.html ) .
315+
290316## Contributing
291317
292318Contributions to Nebulex are very welcome and appreciated!
0 commit comments