Why is there no ByteString => T deserializer?
See original GitHub issueI can do redis.set("key", MyCustomType(42))
as long as I have a valid RedisValueConverter in implicit scope for my custom type.
But when I do redis.get("key")
all I get is a raw Option[ByteString]
and I have to convert it back to my custom type myself.
Why is there not a get[T: RedisValueDeserializer](key: String): Future[Option[T]]
with some basic support for common types (Strings, Ints, Longs, Booleans, Lists, Sets, Maps, etc.)? Then I can have my own RedisValueDeserializer
in scope to deserialize my custom types.
Issue Analytics
- State:
- Created 10 years ago
- Comments:16 (7 by maintainers)
Top Results From Across the Web
No ByteString deserializer found for type models.MpMember ...
I found the solution. I convert the Scala object to Json and save to Redis as a string. object Member { implicit val...
Read more >Serialization Formats - ksqlDB Documentation
ksqlDb deserializes a string as BYTES if it corresponds to a BYTES typed field in the stream. Field Name Case Sensitivity¶. The format...
Read more >Message serializers - Lagom - Microservices Framework
Strict message serializers serialize and deserialize to and from ByteString , that is, they work strictly in memory, while streamed message serializers work ......
Read more >Any - Google Developers
Protobuf library provides support to pack/unpack Any values in the form of utility functions or additional generated methods of the Any type.
Read more >Deserializer in serde_json - Rust - Docs.rs
Reader-based deserializers do not support deserializing borrowed types like &str , since the std::io::Read trait has no non-copying methods – everything it does ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The problem is in this call:
This call does not specify the desired outcome type T so the compiler will look for an unambigious implementation of the type class and finds two instead of one. The solution is to call the method like this:
If you plan to only provide the two default implementations you have now, then there would be a variation of the same trick that would help make it possible to call
get
without a type parameter, namely:Also don’t forget to add the
@implicitNotFound
annotation because it will help end users to find out what they are doing wrong (i.e. the forgot to create a deserializer for their custom type).why empty list " List() " is returning while using redis.get(“myKey”) ?