From a61d11f2de2d355ad8ec12b57dc3a99d3275a05a Mon Sep 17 00:00:00 2001 From: Piotr Maslanka <piotr.maslanka@henrietta.com.pl> Date: Sat, 28 Jan 2017 23:49:42 +0100 Subject: [PATCH] caveats --- docs/caveats.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/caveats.md b/docs/caveats.md index 6cf5f33..517a474 100644 --- a/docs/caveats.md +++ b/docs/caveats.md @@ -5,7 +5,7 @@ Things to look out for ## memoryviews -Since CoolAMQP tries to be fast, it uses memoryviews everywhere. _ReceivedMessage_ objects, and message +Since CoolAMQP tries to be fast, it uses memoryviews everywhere. _ReceivedMessage_ properties, and message properties therefore, are memoryviews. So, it you wanted to read the routing key a message was sent with, or message's encoding, you should do: @@ -17,3 +17,6 @@ received_msg.properties.content_encoding.to_bytes() Only the _body_ property of the message will be a byte object (and not even that it you set an option in Cluster.consume). +Note that YOU, when sending messages, should not use memoryviews. Pass proper byte objects and text objects +as required. + -- GitLab