Run the example code by connecting and then starting the IOLoop.
(self)
| 131 | ) |
| 132 | |
| 133 | def run(self): |
| 134 | """Run the example code by connecting and then starting the IOLoop. |
| 135 | """ |
| 136 | while not self.stopping: |
| 137 | self.connection = None |
| 138 | self.deliveries = {} |
| 139 | self.acked = 0 |
| 140 | self.nacked = 0 |
| 141 | self.message_number = 0 |
| 142 | |
| 143 | try: |
| 144 | self.create_consumers() |
| 145 | self.connection.ioloop.start() |
| 146 | except KeyboardInterrupt: |
| 147 | self.stop() |
| 148 | if (self.connection is not None and |
| 149 | not self.connection.is_closed): |
| 150 | self.connection.ioloop.start() |
| 151 | |
| 152 | logger.info('Stopped') |
| 153 | |
| 154 | def stop_processing(self): |
| 155 | self.channel.stop_consuming() |
no test coverage detected