Mac: clarify runtime comments

This commit is contained in:
Peter Steinberger
2025-12-09 00:08:19 +01:00
parent bc01488a75
commit 5674c9f4c2
12 changed files with 21 additions and 4 deletions

View File

@@ -162,6 +162,7 @@ actor AgentRPC {
}
Task.detached { [weak self] in
// Ensure all waiters are failed if the worker dies (e.g., crash or SIGTERM).
process.waitUntilExit()
await self?.stop()
}
@@ -188,7 +189,7 @@ actor AgentRPC {
self.buffer.removeSubrange(self.buffer.startIndex...range.lowerBound)
guard let line = String(data: lineData, encoding: .utf8) else { continue }
// Handle event envelopes (unsolicited)
// Event frames are pushed without request/response pairing (e.g., heartbeats).
if let event = self.parseHeartbeatEvent(from: line) {
DispatchQueue.main.async {
NotificationCenter.default.post(name: Self.heartbeatNotification, object: event)