Skip to content

Commit 404c6da

Browse files
committed
Improve docs
1 parent 17d79cf commit 404c6da

File tree

8 files changed

+1770
-295
lines changed

8 files changed

+1770
-295
lines changed

AGENTS.md

Lines changed: 846 additions & 0 deletions
Large diffs are not rendered by default.

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [v0.1.0](https://github.com/elixir-nebulex/nebulex_streams/tree/v0.1.0) (2025-11-11)
8+
> [Full Changelog](https://github.com/elixir-nebulex/nebulex_streams/compare/52c4174d9835e0865e3518143ec9c9d2beb122af...v0.1.0)
9+
10+
### Features
11+
12+
- **Real-time Event Streaming**: Processes can subscribe to and react to cache
13+
entry events (inserted, updated, deleted, expired, evicted) as they happen.
14+
- **Partitioned Streams**: Events can be divided into multiple independent
15+
sub-streams for parallel processing and scalability.
16+
- **Event Filtering**: Subscribers can filter to specific event types to reduce
17+
message overhead.
18+
- **Distributed by Design**: Built on Phoenix.PubSub for seamless cluster-wide
19+
event distribution.
20+
- **Automatic Cache Invalidation**: Built-in `Nebulex.Streams.Invalidator`
21+
module for automatic entry removal when changes occur on other nodes.
22+
- **Telemetry Integration**: Comprehensive observability with telemetry events
23+
for monitoring stream and invalidation behavior.
24+
- **Dynamic Cache Support**: Works with both statically-defined and
25+
dynamically-created caches.
26+
- **Custom Partition Routing**: Support for custom hash functions to route
27+
events to specific partitions based on business logic.
28+
29+
### Enhancements
30+
31+
- Comprehensive module documentation with examples and best practices.
32+
- Detailed option documentation with inline examples.
33+
- Troubleshooting guides and performance tuning recommendations.
34+
- Support for event scopes (`:remote`, `:local`, `:all`) in invalidator for
35+
flexible consistency strategies.

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

@@ -287,6 +289,27 @@ Nebulex Streams supports dynamic caches:
287289
MyApp.Cache.subscribe(:my_dynamic_cache, [])
288290
```
289291

292+
## Automatic Cache Invalidation
293+
294+
For distributed cache scenarios, Nebulex Streams includes a built-in
295+
[`Nebulex.Streams.Invalidator`](https://hexdocs.pm/nebulex_streams/Nebulex.Streams.Invalidator.html)
296+
that automatically removes stale entries when they change on other nodes. This
297+
implements a "fail-safe" approach to cache consistency.
298+
299+
```elixir
300+
# Add to your supervision tree after the stream
301+
children = [
302+
MyApp.Cache,
303+
{Nebulex.Streams, cache: MyApp.Cache},
304+
{Nebulex.Streams.Invalidator, cache: MyApp.Cache} # Watch for changes
305+
]
306+
307+
Supervisor.start_link(children, strategy: :rest_for_one)
308+
```
309+
310+
For detailed options and patterns, see the
311+
[Invalidator documentation](https://hexdocs.pm/nebulex_streams/Nebulex.Streams.Invalidator.html).
312+
290313
## Contributing
291314

292315
Contributions to Nebulex are very welcome and appreciated!

0 commit comments

Comments
 (0)