jobqueue: Replace JobArgs() with Job()

JobArgs() function replaced with more general Job() function that
returns all the parameters used to originally define a job during
Enqueue(). This new function enables access to the type of a job in the
queue, which wasn't available until now (except when Dequeueing).
This commit is contained in:
Achilleas Koutsou 2021-01-12 13:49:01 +01:00 committed by Ondřej Budai
parent 75a96bd99d
commit 668fb003ef
6 changed files with 26 additions and 18 deletions

View file

@ -60,8 +60,8 @@ type JobQueue interface {
// Lastly, the IDs of the jobs dependencies are returned.
JobStatus(id uuid.UUID) (result json.RawMessage, queued, started, finished time.Time, canceled bool, deps []uuid.UUID, err error)
// Returns the job's arguments in Raw form.
JobArgs(id uuid.UUID) (args json.RawMessage, err error)
// Job returns all the parameters that define a job (everything provided during Enqueue).
Job(id uuid.UUID) (jobType string, args json.RawMessage, dependencies []uuid.UUID, err error)
}
var (