(self)
| 155 | return result |
| 156 | |
| 157 | def memsize(self): |
| 158 | workers_pids = [ |
| 159 | p.pid if hasattr(p, "pid") else p for p in list(self.pool._processes) |
| 160 | ] |
| 161 | num_workers = len(workers_pids) |
| 162 | if num_workers == 0: |
| 163 | return 0 |
| 164 | elif num_workers > 1: |
| 165 | raise RuntimeError("Unexpected number of workers: %d" % num_workers) |
| 166 | return psutil.Process(workers_pids[0]).memory_info().rss |
| 167 | |
| 168 | def close(self): |
| 169 | self.pool.shutdown(wait=True) |
nothing calls this directly
no outgoing calls
no test coverage detected