-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unrestrict Redis Key and String types #43
Comments
I can head this up, assuming it's a wanted change. |
It makes sense. Fortunately #41 accepts raw bytes input/output without modification, so it can be easily fixed by just replacing key type from To support for arbitrary objects out-of-box, additional changes in formats are needed though. |
The |
+1 .. we already have the machinery in place. |
Looks like you guys do. This would be a welcomed addition. I've taken an initial stab at part of it, but I don't know the code base very well yet. |
Any update on this, @andyscott? It you don't have enough time I can handle this. |
I haven't gotten around to it. Eventually I will, but it you have time and want to do it go ahead! / sent via phone / On Sep 9, 2013, at 22:33, guersam [email protected] wrote:
|
I'm trying to use scala-redis-nb to serialize arbitrary Serializable objects, and currently I have to convert them to Base64 strings because a) scala-redis-nb routes everything to strings and b) The interfaces that can bypass that and read and write bytes are private. I would really appreciate, even if nobody has the time to change everything that is needed, at least consider providing a way to use Format with arbitrary byte content. Thanks, |
Hi Daniel - Which version of scala-redis-nb are u using right now ? Thanks. |
I'm using version 0.3. |
0.3 supports raw bytes in send/receive. Here's an example .. https://github.com/debasishg/scala-redis-nb/blob/master/src/test/scala/com/redis/serialization/SerializationSpec.scala#L71 .. Could u give a sample test case of the requirement ? |
How can I use that to write a Format object that can take a Serializable and process it then, since it only has read and write methods returning strings? Sorry if I misspoke on it not being possible, I just looked around for a way and had not found any. Does the manual conversion handle null bytes properly? Edit: sorry for being a little silly, I think I have it figured out by now, I just have to override the to/fromByteString methods. But it would be better to refactor things a bit somehow because there is no enforced guarantee that read/write can be safely bypassed in all cases. |
What about using Akka's Serialization library? It's an already tested codebase, is very configurable, and already has all the dynamic dispatch work done, which I actually happen to be very interested in. |
A Pull Request will be welcome :-) |
Changes in c7bedc5 restrict Redis string ops to Scala strings. Redis strings and keys are "binary safe, [... and] can contain any kind of data".
Passing in serializable objects as keys was super useful.
See http://redis.io/topics/data-types-intro and http://redis.io/topics/data-types
The text was updated successfully, but these errors were encountered: