Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Baidakou authored Apr 16, 2017
1 parent 86d4bb0 commit 7eb1465
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,22 @@ Method `push_command(const std::string &cmd, C &&contaier, command_callback_t ca

`command_callback_t` is `std::function<void(const boost::system::error_code &error_code, redis_result_t &&result)>`;

### `Subscription<T>`

Subscription is special mode, when redis server operates in `push` mode.

Type `T` can be either TCP socket type or unix-domain sockets (e.g. `boost::asio::ip::tcp::socket` or `boost::asio::local::stream_protocol::socket`).

Constructor takes socket instance (`T&&`) and `command_callback_t callback`, which is executed on every incoming reply; the reply is not necessary `message`, e.g. it can be (un)subscription confirmation from redis.

Method `cancel` cancels all pending I/O operations.

Method `push_command(const std::string &cmd, C &&contaier)` pushes new redis command with optional list of arguments. By semantic the command can be either `subscribe`, `psubscribe`, `unsubscribe` and `punsubscribe`.

```cpp
subscription.push_command("subscribe", {"some-channel-1", "some-channel-2"});
```
### `SyncConnection<T>`
Type `T` can be either TCP socket type or unix-domain sockets (e.g. `boost::asio::ip::tcp::socket` or `boost::asio::local::stream_protocol::socket`).
Expand Down

0 comments on commit 7eb1465

Please sign in to comment.