boostorg / redis

An async redis client designed for performance and scalability
https://www.boost.org/doc/libs/develop/libs/redis/doc/html/index.html
Boost Software License 1.0
212 stars 38 forks source link

Enable reading server pushes in batches #152

Closed mzimbres closed 10 months ago

mzimbres commented 10 months ago

At the moment the asio::channel used to communicate server pushes to the user via async_receive has size 0, which is inefficient under heavy load. Given that the generic_response can contain multiple responses and pushes, there would be no problem is making the channel size configurable by the user.

The implementation should also use the try_send/receive functions to avoid suspension when possible.

It should be also documented that a generic_response might contain multiple server pushes for channels with size != 0 and how to iterate over them, which at the moment must be done by checking nodes with depth 0. In the future we will add a nicer way of iterating over individual messages in a response.