Coverage for src/copytrading_engine/host/pipe/session.py: 100%
10 statements
« prev ^ index » next coverage.py v7.16.2, created at 2026-11-16 16:55 +0000
« prev ^ index » next coverage.py v7.16.2, created at 2026-11-16 16:55 +0000
1"""The pipe session's lifecycle, shared by the server and the handlers that end it."""
3from dataclasses import dataclass
5from copytrading_engine.host.status import EngineState
8@dataclass(slots=True)
9class PipeSession:
10 state: EngineState = "running"
11 process_after_reply: bool = False
12 stop_after_reply: bool = False
14 def stop(self) -> None:
15 """Reply first, then stop reading requests."""
16 self.state = "stopping"
17 self.stop_after_reply = True