i creating large map in messagepack using c++. need multiple languages able have access data.
how store string in redis? there idiomatic way put in memory or should use following?
msgpack::packer<msgpack::sbuffer> pk2(&buffer2); pk2.pack_map(2); pk2.pack(std::string("x")); pk2.pack(3); pk2.pack(std::string("y")); pk2.pack(3.4321); redox rdx; rdx.connect() rdx.command<int>({"rpush", "key_name", buffer2.data()})
sensible depends on you're trying achieve. didn't explain why you're using redis list data structure store msgpack data, unless there's unspecified reason so, i'd go simple strings.
also, example provided not make sense imo because you're not providing key name rpush into. edit: correcting snippet
lastly, if you're using msgpack data, can interesting things lua scripting redis provides cmsgpack library manipulate packed messages.
Comments
Post a Comment