refactor(lab): move execution to Worker and manage replay and transfer lifecycles

This commit is contained in:
DCCONSTRUCTIONS
2026-11-10 01:09:39 +03:00
parent cd34b6ce1a
commit fe5900ff3b
101 changed files with 9305 additions and 2256 deletions
+9 -8
View File
@@ -11,9 +11,10 @@ import os
import shutil
import stat
import threading
from collections.abc import Callable
from collections.abc import Callable, Iterator
from contextlib import contextmanager
from pathlib import Path
from typing import Any
GiB = 1024**3
MiB = 1024**2
@@ -62,12 +63,12 @@ def cache_publication(
root: Path,
additional_bytes: int | Callable[[], int],
*,
kind=None,
limit=None,
reserve=FREE_RESERVE,
max_files=10000,
error_type=CacheCapacityError,
):
kind: str | None = None,
limit: int | None = None,
reserve: int = FREE_RESERVE,
max_files: int = 10000,
error_type: type[Exception] = CacheCapacityError,
) -> Iterator[None]:
"""Lock admission through publication. Count temporary bytes already on disk.
additional_bytes includes only bytes not yet in this root; a file renamed
@@ -118,6 +119,6 @@ def cache_publication(
os.close(fd)
def require_cache_room(root: Path, additional_bytes=0, **kwargs):
def require_cache_room(root: Path, additional_bytes: int = 0, **kwargs: Any) -> None:
with cache_publication(root, additional_bytes, **kwargs):
pass