示例#1
0
 def prepare_message(self, message_data, delivery_mode, priority=0,
         content_type=None, content_encoding=None):
     return {"body": message_data,
             "delivery_tag": gen_unique_id(),
             "priority": priority or 0,
             "content-encoding": content_encoding,
             "content-type": content_type}
示例#2
0
    def _generate_consumer_tag(self):
        """Generate a unique consumer tag.

        :rtype string:

        """
        return "%s.%s-%s" % (self.__class__.__module__,
                             self.__class__.__name__, gen_unique_id())
示例#3
0
文件: messaging.py 项目: nyren/carrot
    def _generate_consumer_tag(self):
        """Generate a unique consumer tag.

        :rtype string:

        """
        return "%s.%s-%s" % (
                self.__class__.__module__,
                self.__class__.__name__,
                gen_unique_id())
示例#4
0
 def prepare_message(self,
                     message_data,
                     delivery_mode,
                     priority=0,
                     content_type=None,
                     content_encoding=None):
     return {
         "body": message_data,
         "delivery_tag": gen_unique_id(),
         "priority": priority or 0,
         "content-encoding": content_encoding,
         "content-type": content_type
     }