-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Description
π Description
PDF fill operations in FireForm are currently synchronous and block the API thread for the entire duration of the request. This becomes a critical bottleneck under concurrent load β e.g., multiple departments submitting forms simultaneously.
π‘ Rationale
For FireForm to scale as a Digital Public Good, it cannot afford to have a single long-running PDF fill block the server. An async job system decouples submission from processing, enabling parallel workloads and a better UX via status polling.
π οΈ Proposed Solution
- Introduce an async job queue using
arqorasynciobackground tasks integrated with FastAPI'sBackgroundTasks - On form submission, immediately return a
job_idwith a202 Acceptedresponse - Add a
GET /api/v1/jobs/{job_id}status endpoint returning{ status, result, error } - Store job state in Redis (for
arq) or in-memory (for lightweight asyncio approach) - Update Docker Compose to include Redis if needed
β Acceptance Criteria
-
POST /api/v1/fillreturns{ job_id, status: "queued" }immediately -
GET /api/v1/jobs/{job_id}returns current status (queued,processing,complete,failed) - Multiple simultaneous submissions are processed concurrently without blocking
- Works within the existing Docker container setup
- Testable via Swagger UI (
/docs)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels