Spawn additional dirty workers. Sends a MANAGE message to the dirty arbiter to spawn workers. Args: count: Number of dirty workers to add (default 1) Returns: Dictionary with added count or error
(self, count: int = 1)
| 306 | } |
| 307 | |
| 308 | def dirty_add(self, count: int = 1) -> dict: |
| 309 | """ |
| 310 | Spawn additional dirty workers. |
| 311 | |
| 312 | Sends a MANAGE message to the dirty arbiter to spawn workers. |
| 313 | |
| 314 | Args: |
| 315 | count: Number of dirty workers to add (default 1) |
| 316 | |
| 317 | Returns: |
| 318 | Dictionary with added count or error |
| 319 | """ |
| 320 | if not self.arbiter.dirty_arbiter_pid: |
| 321 | return { |
| 322 | "success": False, |
| 323 | "error": "Dirty arbiter not running", |
| 324 | } |
| 325 | |
| 326 | count = max(1, int(count)) |
| 327 | return self._send_manage_message("add", count) |
| 328 | |
| 329 | def dirty_remove(self, count: int = 1) -> dict: |
| 330 | """ |