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
230 stars 36 forks source link

Replace the request queue in the connection with a channel #135

Closed mzimbres closed 1 year ago

mzimbres commented 1 year ago

Asio channels are multiple-producers and multiple-consumer channels and can be used to simplify the connection internals by replacing the std::queue and per-request allocation of a timer. See https://github.com/chriskohlhoff/asio/blob/master/asio/src/examples/cpp20/channels/mutual_exclusion_1.cpp

mzimbres commented 1 year ago

After inspecting a bit the implementation, it turns out that a channel can't be used to replace the internal queue because we need the ability to partition the queue and set priorities on requests to support reconnection with proper resp3 handshake.