zio-redis
zio-redis copied to clipboard
#460: Implement CLIENT INFO and CLIENT LIST commands
This PR tries to implement #460.
- Added zio-schema-derivation to redis library-dependencies (needed to create a codec/schema for encode/decode ClientInfo as described here https://redis.io/commands/client-list/)
- Added clientInfo and clientList commands to api/Connection.scala
- Addded ClientListFilter input to allow filter clients in clientList
Maybe is unrelated but I'm facing some blocking issues during test executing (LiveExecutor):
to be able to execute the tests I have to change RedisExecutor run and receive methods:
- Run
(send.forever race receive)
to
(send *> receive).forever
- Receive (I really don't understand this one)
byteStream.read
to
byteStream.read.tap(r => logger.debug(s"Received: $r")))
So, Is it possible that I am introducing some error in the Input/Output encoding without realizing it?
My environment:
-
Redis 7.0.2
-
openjdk 17
-
UPDATE ABOUT LOCKING PROBLEM I Think I found the cause of the blocking problem at #613. Seems to be caused by ClientInfo being a bulkString with a newline character (\n) at the end of the string data.
@jgoday Many thanks for the contribution, and please accept my apology for the very late response. Could you please format the sources and resolve the conflicts? I'll start reviewing it in the meantime.
@mijicd Thank you for your support ! I have squeash it to sync in with master and fix zio-schema errors.
@jgoday when you get a chance, please take a look at the remaining compilation issues :pray:
@jgoday when you get a chance, please take a look at the remaining compilation issues 🙏
Sorry @mijicd, I was struggling with zio-schema, I still can not use automatic derivation agains a case class with more than 22 fields (and I was trying to avoid map fields manually) ...
Closed in favour of #807