Document RuntimeState concurrency model and mark task 5 complete

This commit is contained in:
2026-04-18 19:56:41 +02:00
parent 52e08e17a4
commit be1d66988f
3 changed files with 11 additions and 4 deletions

View File

@@ -5,6 +5,12 @@ exposed through a controlled state manager object. This keeps the FastAPI
framework state bag limited to shared infrastructure handles and immutable
configuration while still allowing existing code to access runtime values via
attribute proxying.
RuntimeState is designed for a single-process, single-worker asyncio
deployment. Mutations must complete without awaiting across read-modify-write
sequences. If BanGUI is ever deployed with multiple workers or across processes,
this module must be replaced with a shared backend such as Redis or shared
memory.
"""
from __future__ import annotations
@@ -13,9 +19,8 @@ import datetime
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Any
from starlette.datastructures import State
import structlog
from starlette.datastructures import State
from app.models.config import PendingRecovery
from app.models.server import ServerStatus