initial structure implemented

docs -> _docs
This commit is contained in:
Oleksandr Bezdieniezhnykh
2025-12-01 14:20:56 +02:00
parent 9134c5db06
commit abc26d5c20
360 changed files with 3881 additions and 101 deletions
@@ -0,0 +1,5 @@
from .base import SSEEventStreamerBase
from .sse_event_streamer import SSEEventStreamer
__all__ = ["SSEEventStreamerBase", "SSEEventStreamer"]
+44
View File
@@ -0,0 +1,44 @@
from abc import ABC, abstractmethod
from typing import AsyncIterator
from models.results import FrameResult
from models.recovery import UserInputRequest
class SSEEventStreamerBase(ABC):
@abstractmethod
async def emit_frame_result(
self, flight_id: str, result: FrameResult
) -> None:
pass
@abstractmethod
async def emit_status_update(
self, flight_id: str, status: dict
) -> None:
pass
@abstractmethod
async def emit_user_input_request(
self, flight_id: str, request: UserInputRequest
) -> None:
pass
@abstractmethod
async def emit_error(
self, flight_id: str, error: str
) -> None:
pass
@abstractmethod
def subscribe(self, flight_id: str) -> AsyncIterator[dict]:
pass
@abstractmethod
async def unsubscribe(self, flight_id: str, subscriber_id: str) -> None:
pass
@abstractmethod
async def get_subscriber_count(self, flight_id: str) -> int:
pass
@@ -0,0 +1,38 @@
from typing import AsyncIterator
from .base import SSEEventStreamerBase
from models.results import FrameResult
from models.recovery import UserInputRequest
class SSEEventStreamer(SSEEventStreamerBase):
async def emit_frame_result(
self, flight_id: str, result: FrameResult
) -> None:
raise NotImplementedError
async def emit_status_update(
self, flight_id: str, status: dict
) -> None:
raise NotImplementedError
async def emit_user_input_request(
self, flight_id: str, request: UserInputRequest
) -> None:
raise NotImplementedError
async def emit_error(
self, flight_id: str, error: str
) -> None:
raise NotImplementedError
async def subscribe(self, flight_id: str) -> AsyncIterator[dict]:
raise NotImplementedError
yield
async def unsubscribe(self, flight_id: str, subscriber_id: str) -> None:
raise NotImplementedError
async def get_subscriber_count(self, flight_id: str) -> int:
raise NotImplementedError