CBCFacil v8.0 - Refactored with AMD GPU support

This commit is contained in:
2026-01-09 13:05:46 -03:00
parent cb17136f21
commit b017504c52
54 changed files with 7251 additions and 3670 deletions

35
core/base_service.py Normal file
View File

@@ -0,0 +1,35 @@
"""
Base service class for CBCFacil services
"""
import logging
from abc import ABC, abstractmethod
from typing import Optional
class BaseService(ABC):
"""Base class for all services"""
def __init__(self, name: str):
self.name = name
self.logger = logging.getLogger(f"{__name__}.{name}")
@abstractmethod
def initialize(self) -> None:
"""Initialize the service"""
pass
@abstractmethod
def cleanup(self) -> None:
"""Cleanup service resources"""
pass
def health_check(self) -> bool:
"""Perform health check"""
return True
def __enter__(self):
self.initialize()
return self
def __exit__(self, exc_type, exc_val, exc_tb):
self.cleanup()