Format routing table into string for log dumps.
(self, indent=0, indent_first=True)
| 144 | return args.update({'x-max-priority': self.max_priority}) |
| 145 | |
| 146 | def format(self, indent=0, indent_first=True): |
| 147 | """Format routing table into string for log dumps.""" |
| 148 | active = self.consume_from |
| 149 | if not active: |
| 150 | return '' |
| 151 | info = [QUEUE_FORMAT.strip().format(q) |
| 152 | for _, q in sorted(active.items())] |
| 153 | if indent_first: |
| 154 | return textindent('\n'.join(info), indent) |
| 155 | return info[0] + '\n' + textindent('\n'.join(info[1:]), indent) |
| 156 | |
| 157 | def select_add(self, queue, **kwargs): |
| 158 | """Add new task queue that'll be consumed from. |