zio-redis icon indicating copy to clipboard operation
zio-redis copied to clipboard

#460: Implement CLIENT INFO and CLIENT LIST commands

Open jgoday opened this issue 2 years ago • 4 comments

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:

  1. Run
(send.forever race receive)

to

(send *> receive).forever
  1. 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 avatar Jul 14 '22 08:07 jgoday

@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 avatar Aug 21 '22 19:08 mijicd

@mijicd Thank you for your support ! I have squeash it to sync in with master and fix zio-schema errors.

jgoday avatar Aug 21 '22 20:08 jgoday

@jgoday when you get a chance, please take a look at the remaining compilation issues :pray:

mijicd avatar Sep 12 '22 08:09 mijicd

@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) ...

jgoday avatar Sep 17 '22 10:09 jgoday

Closed in favour of #807

drmarjanovic avatar Apr 15 '23 22:04 drmarjanovic