(self, max_queue_size: int = 100, result_png_keep_count: Optional[int] = None)
| 53 | usage: Usage | dict | None = None |
| 54 | stop_event: threading.Event = field(default_factory=threading.Event) |
| 55 | thread: Optional[threading.Thread] = None |
| 56 | |
| 57 | |
| 58 | class TaskManager: |
| 59 | def __init__(self, max_queue_size: int = 100, result_png_keep_count: Optional[int] = None): |
| 60 | self.max_queue_size = max_queue_size |
| 61 | if result_png_keep_count is None: |
| 62 | result_png_keep_count = _env_positive_int("LIGHTX2V_RESULT_PNG_KEEP_COUNT", 50) |
| 63 | self.result_png_keep_count = result_png_keep_count |
| 64 | |
| 65 | self._tasks: OrderedDict[str, TaskInfo] = OrderedDict() |
| 66 | self._lock = threading.RLock() |
| 67 | self._task_available = threading.Condition(self._lock) |
| 68 | |
| 69 | self._processing_lock = threading.Lock() |
| 70 | self._current_processing_task: Optional[str] = None |
| 71 | |
| 72 | self.total_tasks = 0 |
| 73 | self.completed_tasks = 0 |
| 74 | self.failed_tasks = 0 |
nothing calls this directly
no test coverage detected