Idea: only use hiredis reader?
Opened this issue · 1 comments
Hiredis is quite a pain to bind, and it's lacking behind in SSL capabilities etc.
I don't think there is much in the hiredis IO layer that really justifies binding the entire library.
It would make sense to only bind the redisReader
part, do the IO in Pure Ruby, and call redisReaderFeed + redisReaderGetReply
.
Surprisingly I was also hoping that the modern version of hiredis could have at least some sane support of SSL, however, it seems to be not the case. Please note, that not only connect must be aware of SSL specific, but also closing is tricky to handle in asynchronous mode (e.g. SSL_close can return WANT_READ/WANT_WRITE
that should be handled properly).
If an SSL connection is not closed properly, then OpenSSL does not put it into SSL cache, meaning that connection renegotiation will be expensive due to the full handshake.
Sometimes I think that there should be some better maintained Redis C library to be honest.