Initialize the local work queue. Args: workspace_path: Local directory path where the queue index, results, and locks are stored.
(self, workspace_path: str)
| 168 | """ |
| 169 | |
| 170 | def __init__(self, workspace_path: str): |
| 171 | """ |
| 172 | Initialize the local work queue. |
| 173 | |
| 174 | Args: |
| 175 | workspace_path: Local directory path where the queue index, |
| 176 | results, and locks are stored. |
| 177 | """ |
| 178 | self.workspace_path = os.path.abspath(workspace_path) |
| 179 | os.makedirs(self.workspace_path, exist_ok=True) |
| 180 | |
| 181 | # Local index file (compressed) |
| 182 | self._index_path = os.path.join(self.workspace_path, "work_index_list.csv.zstd") |
| 183 | |
| 184 | # Output directory for completed tasks |
| 185 | self._results_dir = os.path.join(self.workspace_path, "results") |
| 186 | os.makedirs(self._results_dir, exist_ok=True) |
| 187 | |
| 188 | # Directory for lock files |
| 189 | self._locks_dir = os.path.join(self.workspace_path, "worker_locks") |
| 190 | os.makedirs(self._locks_dir, exist_ok=True) |
| 191 | |
| 192 | # Internal queue |
| 193 | self._queue: Queue[Any] = Queue() |
| 194 | |
| 195 | async def populate_queue(self, work_paths: List[str], items_per_group: int) -> None: |
| 196 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected