Admiral/admiral-worker/core/repos/WorkerJobStatusRepo.py
2025-06-24 14:22:50 +02:00

21 lines
550 B
Python

from abc import ABC, abstractmethod
from typing import Optional
from core.domain.worker.WorkerJob import WorkerJob
from core.domain.worker.WorkerJobStatus import WorkerJobStatus
from core.types.Id import Id
class WorkerJobStatusRepo(ABC):
@abstractmethod
def getAll(self) -> list[WorkerJobStatus]:
pass
@abstractmethod
def get(self, id: Id[WorkerJobStatus]) -> Optional[WorkerJobStatus]:
pass
@abstractmethod
def post(self, workerJobId: Id[WorkerJob], ramTaken: float, cpuUtilization: float, objective: int) -> WorkerJobStatus:
pass