Skip to content

Commit 1e3f77a

Browse files
committed
Add changes.md.
1 parent 627ba90 commit 1e3f77a

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

changes.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# v0.10.0
2+
3+
## Cluster Client
4+
5+
`Async::Redis::ClusterClient` is a new class that provides a high-level interface to a Redis Cluster. Due to the way clustering works, it does not provide the same interface as the `Async::Redis::Client` class. Instead, you must request an appropriate client for the key you are working with.
6+
7+
```ruby
8+
endpoints = [
9+
Async::Redis::Endpoint.parse("redis://redis-a"),
10+
Async::Redis::Endpoint.parse("redis://redis-b"),
11+
Async::Redis::Endpoint.parse("redis://redis-c"),
12+
]
13+
14+
cluster_client = Async::Redis::ClusterClient.new(endpoints)
15+
16+
cluster_client.clients_for("key") do |client|
17+
puts client.get("key")
18+
end
19+
```
20+
21+
## Sentinel Client
22+
23+
The previous implementation `Async::Redis::SentinelsClient` has been replaced with `Async::Redis::SentinelClient`. This new class uses `Async::Redis::Endpoint` objects to represent the sentinels and the master.
24+
25+
```ruby
26+
sentinels = [
27+
Async::Redis::Endpoint.parse("redis://redis-sentinel-a"),
28+
Async::Redis::Endpoint.parse("redis://redis-sentinel-b"),
29+
Async::Redis::Endpoint.parse("redis://redis-sentinel-c"),
30+
]
31+
32+
master_client = Async::Redis::SentinelClient.new(sentinels)
33+
slave_client = Async::Redis::SentinelClient.new(sentinels, role: :slave)
34+
35+
master_client.session do |session|
36+
session.set("key", "value")
37+
end
38+
39+
slave_client.session do |session|
40+
puts session.get("key")
41+
end
42+
```
43+
44+
## Integration Tests
45+
46+
Integration tests for Redis Cluster and Sentinel have been added, using `docker-compose` to start the required services and run the tests. These tests are not part of the default test suite and must be run separate. See the documentation in the `sentinel/` and `cluster/` directories for more information.

0 commit comments

Comments
 (0)