Closed ersidam closed 8 years ago
Can you provide a reproducible example?
I'm reading some json string and make some calculation... Then I need to return a json string but when working with redisLPush, it returns some value like in screenshoot. firstly I think problem in jsonlite so I send just text string, there is no change in result.
library("rredis"); library("jsonlite"); redisConnect(host = "192.168.1.25",port = 6379); while(TRUE){ req <- redisRPop("request"); if(!is.null(req)){
data <- fromJSON(req);
#calculations
#print(data);
res <- toJSON(data);
redisLPush(key = 'response',value = res );
} }
See the 'raw' options to send un-serialized data to Redis (also discussed in the vignette).
The default sends serialized R objects.
On 9/4/15, ersidam notifications@github.com wrote:
I'm reading some json string and make some calculation... Then I need to return a json string but when working with redisLPush, it returns some value like in screenshoot. firstly I think problem in jsonlite so I send just text string, there is no change in result.
library("rredis"); library("jsonlite"); redisConnect(host = "192.168.1.25",port = 6379); while(TRUE){ req <- redisRPop("request"); if(!is.null(req)){
data <- fromJSON(req); #calculations #print(data); res <- toJSON(data); redisLPush(key = 'response',value = res );
} }
Reply to this email directly or view it on GitHub: https://github.com/bwlewis/rredis/issues/31#issuecomment-137796398
applying charToRaw() function before sending data tp redis is a solution thanks
Great, glad that works. I'm trying to get doRedis updated on CRAN soon, but still have some work to do on the package... Closing this issue now.
function is not adding correnct value to list, it can be a character encoding problem