Closed dqdinh closed 7 years ago
Unless you are returning something like HList
of Shapeless, List(true, Some(debasish), None)
can only be typed as List[Any]
.
Also if you look at the function definition of pipeline
, it returns an Option[List[Any]]
. So, yeah, it's a known limitation and custom processing needs to be done at the client side to retrieve the types.
Maybe using HList
in redisclient can be an interesting idea to handle such situations.
Thanks for the feedback!
Hi,
I’m using the
pipeline
function to do batch atomic Redis operations — https://github.com/debasishg/scala-redis/blob/master/src/main/scala/com/redis/RedisClient.scala#L113-L129The pipeline function does not retain type information and instead lumps all transaction results as
List[Any]
. This is unfortunate because running any method off of RedisClient will return the correct type information.Let me know if this a known issue or if I need to re-read the source and tests?
This is strange also because the tests show that the return types retains their type information (https://github.com/debasishg/scala-redis/blob/master/src/test/scala/com/redis/PipelineSpec.scala#L28-L36)
Other than converting the
Any
result to a string, parsing, and converting back to the target data structure, do you have any ideas on how to retain the type information for transactions usingpipeline
?Here's my console output: