Skip to content

Commit 6387457

Browse files
committed
Improve docs
1 parent 17d79cf commit 6387457

File tree

8 files changed

+1774
-296
lines changed

8 files changed

+1774
-296
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: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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
3133
end
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:
287292
MyApp.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

292318
Contributions to Nebulex are very welcome and appreciated!

0 commit comments

Comments
 (0)