Skip to content
This repository was archived by the owner on Apr 6, 2019. It is now read-only.

Commit 12ddb5a

Browse files
committed
[3.3.0] update readme
1 parent 009bdee commit 12ddb5a

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

README.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ client.get("hello", [](cpp_redis::reply& reply) {
2020
std::cout << reply << std::endl;
2121
});
2222

23-
client.commit();
24-
# or client.sync_commit(); for synchronous call
23+
client.sync_commit();
24+
# or client.commit(); for synchronous call
2525
```
2626
`cpp_redis::redis_client` [full documentation](https://github.com/Cylix/cpp_redis/wiki/Redis-Client) and [detailed example](https://github.com/Cylix/cpp_redis/wiki/Examples#redis-client).
2727
More about [cpp_redis::reply](https://github.com/Cylix/cpp_redis/wiki/Replies).
@@ -40,11 +40,30 @@ sub.psubscribe("*", [](const std::string& chan, const std::string& msg) {
4040
std::cout << "PMESSAGE " << chan << ": " << msg << std::endl;
4141
});
4242

43-
sub.commit();
44-
# or sub.sync_commit(); for synchronous call
43+
sub.sync_commit();
44+
# or sub.commit(); for synchronous call
4545
```
4646
`cpp_redis::redis_subscriber` [full documentation](https://github.com/Cylix/cpp_redis/wiki/Redis-Subscriber) and [detailed example](https://github.com/Cylix/cpp_redis/wiki/Examples#redis-subscriber).
4747

48+
`cpp_redis::future_client`:
49+
```cpp
50+
cpp_redis::future_client client;
51+
52+
client.connect();
53+
54+
auto set = client.set("hello", "42");
55+
auto decrby = client.decrby("hello", 12);
56+
auto get = client.get("hello");
57+
58+
client.sync_commit();
59+
# or client.commit(); for synchronous call
60+
61+
std::cout << "set 'hello' 42: " << set.get() << std::endl;
62+
std::cout << "After 'hello' decrement by 12: " << decrby.get() << std::endl;
63+
std::cout << "get 'hello': " << get.get() << std::endl;
64+
```
65+
`cpp_redis::future_client` [full documentation](https://github.com/Cylix/cpp_redis/wiki/Future-Client) and [detailed example](https://github.com/Cylix/cpp_redis/wiki/Examples#future-client).
66+
4867
## Wiki
4968
A [Wiki](https://github.com/Cylix/cpp_redis/wiki) is available and provides full documentation for the library as well as [installation explanations](https://github.com/Cylix/cpp_redis/wiki/Installation).
5069

0 commit comments

Comments
 (0)