Back to Spacedrive

Job Manager for Task Scheduling

.tasks/core/JOB-001-job-manager.md

0.4.3855 B
Original Source

Description

A JobManager will be implemented for each library to schedule, execute, and monitor background tasks. It will be built on top of a generic TaskSystem for concurrency management.

Implementation Notes

  • The JobManager will be defined in src/infrastructure/jobs/manager.rs.
  • It maintains its own private database (jobs.db) for storing job state, history, and checkpoints.
  • It is responsible for resuming interrupted jobs on startup.
  • It provides APIs to dispatch, pause, and resume jobs.

Acceptance Criteria

  • Each library has its own JobManager instance.
  • The manager can dispatch a new job and return a JobHandle.
  • The manager can list jobs by status by querying both memory and its database.
  • Interrupted jobs (e.g., from a crash) are correctly paused and can be resumed on next startup.