INNER CODE UNIT · Python
__init__
NextWeb4/lan-file-transfer · lan_transfer/server.py:18
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