Skip to content
This repository was archived by the owner on Apr 6, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2,473 changes: 2,473 additions & 0 deletions .doxygen

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ language: cpp
compiler:
- clang
- gcc
cache: ccache

cache: ccache

os:
- linux
Expand Down Expand Up @@ -35,4 +35,3 @@ install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then (redis-server&); fi

script: mkdir build && cd build && cmake .. -DBUILD_TESTS=true -DBUILD_EXAMPLES=true && make && ./bin/cpp_redis_tests

42 changes: 40 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,52 @@
# Changelog

## [v4.0.0](https://github.com/Cylix/cpp_redis/releases/tag/4.0.0)
### Tag
`4.0.0`.
### Date
September 20th, 2017
### Changes
* ZADD score param changed from map to multimap to allow multiple elements with same score
* connection_callback (replacement of disconnection_callback). Called for any steps of connection process (attempt, success, failure, reconnection, drop, ...)
### Additions
* Sentinel support
* Automatic reconnection if requested
* Connection timeout
* Ability to set number of io workers if you are working with tacopie
* `redis_client` renamed into `client`
* `redis_subscriber` renamed into `subscriber`
* commands that failed to be sent (client not connected or disconnected) get their callback called with an error reply `connection failure`. This ensure that now all callbacks are always called
* if reconnection process is enabled and succeed, failed commands are resent
* if you send command and commit while client is not connected, it will now dismiss the commands and call their callback with an error, or resend them if reconnection is enabled. This is a change compared to the existing behavior that simply kept the commands in the buffer.
* doxygen documentation
### Removals
* future_client: all functions have been merge into the redis_client
* disconnection_callback: it is now replaced by the connection callback

This is a major release with lots of breaking changes.
It aims to enable high availability configuration as well as improved consistency with an enhanced design.

If you are upgrading please consider the following breaking changes:
* `redis_client` is now `client` and `redis_subscriber` is now `subscriber`
* `future_client` has been removed, but it is actually merged into `client`. Simply switch from `future_client` to `client` and you will have the same behavior
* `disconnection_callback` has been removed and replaced by a `connection_callback`. If you are looking for exact same behavior, you will have to check if the state param is equal to `dropped`.
* commands callbacks are always called. In case of failure, an error reply is passed in.

Any other changes should not be breaking changes but you might be interested into the added features.



## [v3.5.4](https://github.com/Cylix/cpp_redis/releases/tag/3.5.4)
### Tag
`3.5.4`.
### Date
August 24th, 2017
### Changes
* bump tacopie to fix #85 - select keep sleeping and does not process incoming read/write events
* fix issue #86 by changing some int32_t to int64_t (was causing overflow leading to stuck program on some architecture)
* improve travis build with caching
### Additions
None
* ZADD command
* CLIENT KILL
### Removals
None

Expand Down
17 changes: 14 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,17 @@ include_directories(${CPP_REDIS_INCLUDES} ${DEPS_INCLUDES})
###
# sources
###
set(SRC_DIRS "sources" "sources/network" "sources/builders" "includes/cpp_redis" "includes/cpp_redis/builders" "includes/cpp_redis/network")
set(SRC_DIRS "sources"
"sources/builders"
"sources/core"
"sources/misc"
"sources/network"
"includes/cpp_redis"
"includes/cpp_redis/builders"
"includes/cpp_redis/core"
"includes/cpp_redis/misc"
"includes/cpp_redis/network")

foreach(dir ${SRC_DIRS})
# get directory sources and headers
file(GLOB s_${dir} "${dir}/*.cpp")
Expand Down Expand Up @@ -138,11 +148,12 @@ ELSE ()
target_link_libraries(${PROJECT} pthread)
ENDIF (WIN32)

if(TACOPIE_LIBRARY)
if (TACOPIE_LIBRARY)
target_link_libraries(${PROJECT} ${TACOPIE_LIBRARY})
else()
target_link_libraries(${PROJECT} tacopie)
endif()
endif(TACOPIE_LIBRARY)


# __CPP_REDIS_READ_SIZE
IF (READ_SIZE)
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ cmake .. -DCMAKE_BUILD_TYPE=Release
make
# Run tests and examples
./bin/cpp_redis_tests
./bin/redis_subscriber
./bin/redis_client
./bin/subscriber
./bin/client
```

## 5. Code your changes
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
`cpp_redis` has **no dependency**. Its only requirement is `C++11`.

## Example
### cpp_redis::redis_client
### cpp_redis::client
```cpp
cpp_redis::redis_client client;
cpp_redis::client client;

client.connect();

Expand All @@ -23,12 +23,12 @@ client.get("hello", [](cpp_redis::reply& reply) {
client.sync_commit();
# or client.commit(); for synchronous call
```
`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).
`cpp_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).
More about [cpp_redis::reply](https://github.com/Cylix/cpp_redis/wiki/Replies).

### cpp_redis::redis_subscriber
### cpp_redis::subscriber
```cpp
cpp_redis::redis_subscriber sub;
cpp_redis::subscriber sub;

sub.connect();

Expand All @@ -42,7 +42,7 @@ sub.psubscribe("*", [](const std::string& chan, const std::string& msg) {
sub.sync_commit();
# or sub.commit(); for synchronous call
```
`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).
`cpp_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).

### cpp_redis::future_client
```cpp
Expand Down
115 changes: 115 additions & 0 deletions docs/html/annotated.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cpp_redis: Class List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="cpp_redis_logo.jpg"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">cpp_redis
&#160;<span id="projectnumber">4.0.0</span>
</div>
<div id="projectbrief">cpp_redis is a C++11 Asynchronous Multi-Platform Lightweight Redis Client, with support for synchronous operations and pipelining.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
<div class="headertitle">
<div class="title">Class List</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock">Here are the classes, structs, unions and interfaces with brief descriptions:</div><div class="directory">
<div class="levels">[detail level <span onclick="javascript:toggleLevel(1);">1</span><span onclick="javascript:toggleLevel(2);">2</span><span onclick="javascript:toggleLevel(3);">3</span><span onclick="javascript:toggleLevel(4);">4</span>]</div><table class="directory">
<tr id="row_0_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_0_" class="arrow" onclick="toggleFolder('0_')">&#9660;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespacecpp__redis.html" target="_self">cpp_redis</a></td><td class="desc"></td></tr>
<tr id="row_0_0_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_0_" class="arrow" onclick="toggleFolder('0_0_')">&#9660;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespacecpp__redis_1_1builders.html" target="_self">builders</a></td><td class="desc"></td></tr>
<tr id="row_0_0_0_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classcpp__redis_1_1builders_1_1array__builder.html" target="_self">array_builder</a></td><td class="desc"></td></tr>
<tr id="row_0_0_1_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classcpp__redis_1_1builders_1_1builder__iface.html" target="_self">builder_iface</a></td><td class="desc"></td></tr>
<tr id="row_0_0_2_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classcpp__redis_1_1builders_1_1bulk__string__builder.html" target="_self">bulk_string_builder</a></td><td class="desc"></td></tr>
<tr id="row_0_0_3_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classcpp__redis_1_1builders_1_1error__builder.html" target="_self">error_builder</a></td><td class="desc"></td></tr>
<tr id="row_0_0_4_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classcpp__redis_1_1builders_1_1integer__builder.html" target="_self">integer_builder</a></td><td class="desc"></td></tr>
<tr id="row_0_0_5_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classcpp__redis_1_1builders_1_1reply__builder.html" target="_self">reply_builder</a></td><td class="desc"></td></tr>
<tr id="row_0_0_6_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classcpp__redis_1_1builders_1_1simple__string__builder.html" target="_self">simple_string_builder</a></td><td class="desc"></td></tr>
<tr id="row_0_1_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_1_" class="arrow" onclick="toggleFolder('0_1_')">&#9660;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespacecpp__redis_1_1helpers.html" target="_self">helpers</a></td><td class="desc"></td></tr>
<tr id="row_0_1_0_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structcpp__redis_1_1helpers_1_1back.html" target="_self">back</a></td><td class="desc"></td></tr>
<tr id="row_0_1_1_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structcpp__redis_1_1helpers_1_1back_3_01_t_01_4.html" target="_self">back&lt; T &gt;</a></td><td class="desc"></td></tr>
<tr id="row_0_1_2_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structcpp__redis_1_1helpers_1_1front.html" target="_self">front</a></td><td class="desc"></td></tr>
<tr id="row_0_1_3_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structcpp__redis_1_1helpers_1_1is__different__types.html" target="_self">is_different_types</a></td><td class="desc"></td></tr>
<tr id="row_0_1_4_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structcpp__redis_1_1helpers_1_1is__different__types_3_01_t1_01_4.html" target="_self">is_different_types&lt; T1 &gt;</a></td><td class="desc"></td></tr>
<tr id="row_0_1_5_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structcpp__redis_1_1helpers_1_1is__type__present.html" target="_self">is_type_present</a></td><td class="desc"></td></tr>
<tr id="row_0_1_6_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structcpp__redis_1_1helpers_1_1is__type__present_3_01_t1_00_01_t2_01_4.html" target="_self">is_type_present&lt; T1, T2 &gt;</a></td><td class="desc"></td></tr>
<tr id="row_0_2_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_2_" class="arrow" onclick="toggleFolder('0_2_')">&#9660;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespacecpp__redis_1_1network.html" target="_self">network</a></td><td class="desc"></td></tr>
<tr id="row_0_2_0_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classcpp__redis_1_1network_1_1redis__connection.html" target="_self">redis_connection</a></td><td class="desc"></td></tr>
<tr id="row_0_2_1_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classcpp__redis_1_1network_1_1tcp__client.html" target="_self">tcp_client</a></td><td class="desc"></td></tr>
<tr id="row_0_2_2_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_0_2_2_" class="arrow" onclick="toggleFolder('0_2_2_')">&#9660;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classcpp__redis_1_1network_1_1tcp__client__iface.html" target="_self">tcp_client_iface</a></td><td class="desc"></td></tr>
<tr id="row_0_2_2_0_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structcpp__redis_1_1network_1_1tcp__client__iface_1_1read__request.html" target="_self">read_request</a></td><td class="desc"></td></tr>
<tr id="row_0_2_2_1_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structcpp__redis_1_1network_1_1tcp__client__iface_1_1read__result.html" target="_self">read_result</a></td><td class="desc"></td></tr>
<tr id="row_0_2_2_2_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structcpp__redis_1_1network_1_1tcp__client__iface_1_1write__request.html" target="_self">write_request</a></td><td class="desc"></td></tr>
<tr id="row_0_2_2_3_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structcpp__redis_1_1network_1_1tcp__client__iface_1_1write__result.html" target="_self">write_result</a></td><td class="desc"></td></tr>
<tr id="row_0_3_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_3_" class="arrow" onclick="toggleFolder('0_3_')">&#9660;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classcpp__redis_1_1client.html" target="_self">client</a></td><td class="desc"></td></tr>
<tr id="row_0_3_0_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structcpp__redis_1_1client_1_1command__request.html" target="_self">command_request</a></td><td class="desc"></td></tr>
<tr id="row_0_4_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classcpp__redis_1_1logger.html" target="_self">logger</a></td><td class="desc"></td></tr>
<tr id="row_0_5_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classcpp__redis_1_1logger__iface.html" target="_self">logger_iface</a></td><td class="desc"></td></tr>
<tr id="row_0_6_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classcpp__redis_1_1redis__error.html" target="_self">redis_error</a></td><td class="desc"></td></tr>
<tr id="row_0_7_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classcpp__redis_1_1reply.html" target="_self">reply</a></td><td class="desc"></td></tr>
<tr id="row_0_8_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_8_" class="arrow" onclick="toggleFolder('0_8_')">&#9660;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classcpp__redis_1_1sentinel.html" target="_self">sentinel</a></td><td class="desc"></td></tr>
<tr id="row_0_8_0_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classcpp__redis_1_1sentinel_1_1sentinel__def.html" target="_self">sentinel_def</a></td><td class="desc"></td></tr>
<tr id="row_0_9_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_9_" class="arrow" onclick="toggleFolder('0_9_')">&#9660;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classcpp__redis_1_1subscriber.html" target="_self">subscriber</a></td><td class="desc"></td></tr>
<tr id="row_0_9_0_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structcpp__redis_1_1subscriber_1_1callback__holder.html" target="_self">callback_holder</a></td><td class="desc"></td></tr>
</table>
</div><!-- directory -->
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
Loading