Get the queue's number of tasks in each state. Returns dict with queue size for the QUEUED, SCHEDULED, and ACTIVE states. Does not include size of error queue.
(self, queue: str)
| 475 | return task |
| 476 | |
| 477 | def get_queue_sizes(self, queue: str) -> Dict[str, int]: |
| 478 | """ |
| 479 | Get the queue's number of tasks in each state. |
| 480 | |
| 481 | Returns dict with queue size for the QUEUED, SCHEDULED, and ACTIVE |
| 482 | states. Does not include size of error queue. |
| 483 | """ |
| 484 | |
| 485 | states = [QUEUED, SCHEDULED, ACTIVE] |
| 486 | pipeline = self.connection.pipeline() |
| 487 | for state in states: |
| 488 | pipeline.zcard(self._key(state, queue)) |
| 489 | results = pipeline.execute() |
| 490 | return dict(zip(states, results)) |
| 491 | |
| 492 | def get_sizes_for_queues_and_states( |
| 493 | self, queues_and_states: List[Tuple[str, str]] |