feat(perception): resume full graph on fresh input without restarting models
This commit is contained in:
@@ -227,8 +227,10 @@ class StreamingLifecycle:
|
||||
self._check(start)
|
||||
if self.continuity is None or self._source_clock_ns is None:
|
||||
raise ValueError("resumable input was not enabled")
|
||||
if any(self._active.values()) or (
|
||||
self._ingress_thread is not None and self._ingress_thread.is_alive()
|
||||
if (
|
||||
not self.mailbox.epoch_drained
|
||||
or any(self._active.values())
|
||||
or (self._ingress_thread is not None and self._ingress_thread.is_alive())
|
||||
):
|
||||
raise StreamSuspended("old epoch callbacks or connection still active")
|
||||
if self.continuity.phase != "waiting":
|
||||
|
||||
@@ -228,3 +228,9 @@ class StreamMailbox:
|
||||
if self.done or self._owned or self.external_pending:
|
||||
raise ValueError("old epoch still owns work or mailbox is closed")
|
||||
self._last_sequence = -1
|
||||
|
||||
@property
|
||||
def epoch_drained(self) -> bool:
|
||||
"""Resident scratch may remain; no old input/result may still be owned."""
|
||||
with self.condition:
|
||||
return not self.done and not self._owned and not self.external_pending
|
||||
|
||||
Reference in New Issue
Block a user