spacedrive/.tasks/JOB-001-job-manager.md
2025-09-06 21:00:37 -04:00

1019 B

id, title, status, assignee, parent, priority, tags, whitepaper
id title status assignee parent priority tags whitepaper
JOB-001 Job Manager for Task Scheduling Done james JOB-000 High
core
jobs
Section 4.4

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.