示例#1
0
 def callback(message):
     messages.append(message)
     if len(messages) < 3:
         raise exceptions.Nack()
示例#2
0
 def callback(message):
     """Nack the message, then halt."""
     nacked_messages.append(message)
     if len(nacked_messages) == 2:
         raise exceptions.HaltConsumer()
     raise exceptions.Nack()