Register which apps a worker has loaded. Updates both app_worker_map and worker_app_map to track the bidirectional relationship between workers and apps. Args: worker_pid: The PID of the worker app_paths: List of app import paths loaded by t
(self, worker_pid, app_paths)
| 197 | return app_paths |
| 198 | |
| 199 | def _register_worker_apps(self, worker_pid, app_paths): |
| 200 | """ |
| 201 | Register which apps a worker has loaded. |
| 202 | |
| 203 | Updates both app_worker_map and worker_app_map to track the |
| 204 | bidirectional relationship between workers and apps. |
| 205 | |
| 206 | Args: |
| 207 | worker_pid: The PID of the worker |
| 208 | app_paths: List of app import paths loaded by this worker |
| 209 | """ |
| 210 | self.worker_app_map[worker_pid] = list(app_paths) |
| 211 | |
| 212 | for app_path in app_paths: |
| 213 | if app_path not in self.app_worker_map: |
| 214 | self.app_worker_map[app_path] = set() |
| 215 | self.app_worker_map[app_path].add(worker_pid) |
| 216 | |
| 217 | def _unregister_worker(self, worker_pid): |
| 218 | """ |