Пример #1
0
 def callback(message):
     messages.append(message)
     raise exceptions.Drop()
Пример #2
0
 def callback(message):
     """Drop 1 message and then halt on the second message."""
     dropped_messages.append(message)
     if len(dropped_messages) == 2:
         raise exceptions.HaltConsumer()
     raise exceptions.Drop()