INNER CODE UNIT · Python

LocalServer

NextWeb4/lan-file-transfer · lan_transfer/server.py:17

class LocalServer:
    def __init__(self, config: AppConfig, storage: StorageManager):
        self.config = config
        self.storage = storage
        self._thread: threading.Thread | None = None
        self._server: uvicorn.Server | None = None

    @property
    def is_running(self) -> bool:
        return bool(self.has_live_thread and self._server and self._server.started)

    @property
    def has_live_thread(self) -> bool:
        return bool(self._thread and self._thread.is_alive())

    def start(self) -> None:
        if self._thread and self._thread.is_alive():
            return

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…