Hi, I love the API but I have a suggestion for the GET /queue/{queue_name}/job endpoint. The documentation says: "When a client gets a job in this way, the job is marked as running, and is removed from the queue." GET requests should be safe (not modify the resource) and idempotent (multiple request have the same effect as a single one). Perhaps use the PATCH method because the worker wants to change the created status to running. This gives workers two options:
- Use
PATCH /queue/{queue_name}/job to mark the next job on the queue as running and retrieve the id and input in one atomic operation.
- Use
GET /queue/{queue_name}/job to only "peek" at the next available job, to decide if they want it or not, and then PATCH /job/{job_id} to mark it as running. If another worker already took it, the response code is 409 (Conflict).
Does that make sense? Thanks anyway, this is a nice job queue server!
Hi, I love the API but I have a suggestion for the
GET /queue/{queue_name}/jobendpoint. The documentation says: "When a client gets a job in this way, the job is marked as running, and is removed from the queue." GET requests should be safe (not modify the resource) and idempotent (multiple request have the same effect as a single one). Perhaps use the PATCH method because the worker wants to change thecreatedstatus torunning. This gives workers two options:PATCH /queue/{queue_name}/jobto mark the next job on the queue asrunningand retrieve theidandinputin one atomic operation.GET /queue/{queue_name}/jobto only "peek" at the next available job, to decide if they want it or not, and thenPATCH /job/{job_id}to mark it as running. If another worker already took it, the response code is 409 (Conflict).Does that make sense? Thanks anyway, this is a nice job queue server!