(self, max=None, min=None)
| 96 | self.pool.maintain_pool() |
| 97 | |
| 98 | def update(self, max=None, min=None): |
| 99 | with self.mutex: |
| 100 | if max is not None: |
| 101 | if max < self.processes: |
| 102 | self._shrink(self.processes - max) |
| 103 | self._update_consumer_prefetch_count(max) |
| 104 | self.max_concurrency = max |
| 105 | if min is not None: |
| 106 | if min > self.processes: |
| 107 | self._grow(min - self.processes) |
| 108 | self.min_concurrency = min |
| 109 | return self.max_concurrency, self.min_concurrency |
| 110 | |
| 111 | def scale_up(self, n): |
| 112 | self._last_scale_up = monotonic() |