Resolve "xadd and get_last are not serialized / de-serialized"
Description
Delegate the work of parsing BECMessage
header to the BEC msgpack decoder. Like this we can
call MsgpackSerialization.loads()
on any msgpack-encoded string -> makes it easier to implement
the requested feature:
-
xadd
has been modified to encode data usingMsgpakSerialization.dumps()
-
xread
,get_last
have been modified to decode data usingMsgpackSerialization.loads()
-
pipe
keyword argument cannot be used anymore when deserializing (xread
,get_last
), since the return values from Redis are special it makes it difficult to handle this properly (as it is not justBECMessage
or values, but a mix of dict and lists and values, includingBECMessage
) - are pipelines andxread
,get_last
really needed? Don't think so
Tests have been adapted to changes, and a new test has been added to xadd
/get_last
a BECMessage
.
Note: it seems to me the special ID $
can be used to replace the costly round-trip to redis
to get the latest generated index. So I changed that too.
Closes #186 (closed)
Edited by guijar_m