Description:
The base worker class in bindu/server/workers/base.py has TODO comments and raises NotImplementedError for pause and resume operations. These critical task lifecycle features are called from the handler but lack implementation, preventing users from pausing long-running tasks or resuming suspended ones. This impacts usability in production scenarios with interruptible workflows.
Steps to Fix:
Read bindu/server/workers/base.py to understand the existing task state management and storage interface.
Implement _handle_pause(): Serialize current task execution state (e.g., agent context, partial results) to storage, update task state to "suspended", release resources.
Implement _handle_resume(): Restore state from storage, update state to "resumed", continue execution from checkpoint using the scheduler.
Add unit tests in tests/unit/test_workers.py (create if missing) covering pause/resume cycles with mock storage.
Update README.md or docs/SCHEDULER.md to document the new functionality.
Test end-to-end with pytest tests/unit/ and verify in integration tests.
Description:
The base worker class in bindu/server/workers/base.py has TODO comments and raises NotImplementedError for pause and resume operations. These critical task lifecycle features are called from the handler but lack implementation, preventing users from pausing long-running tasks or resuming suspended ones. This impacts usability in production scenarios with interruptible workflows.
Steps to Fix:
Read bindu/server/workers/base.py to understand the existing task state management and storage interface.
Implement _handle_pause(): Serialize current task execution state (e.g., agent context, partial results) to storage, update task state to "suspended", release resources.
Implement _handle_resume(): Restore state from storage, update state to "resumed", continue execution from checkpoint using the scheduler.
Add unit tests in tests/unit/test_workers.py (create if missing) covering pause/resume cycles with mock storage.
Update README.md or docs/SCHEDULER.md to document the new functionality.
Test end-to-end with pytest tests/unit/ and verify in integration tests.