introduce and use a flexible job queue system
This MR introduces a new job queue system, implemented by the Gargantext.Utils.Jobs.*
modules.
-
Queue
implements the actual queue(s). We have one queue per "job type" and will draw the next job to run from the highest priority job type's queue. -
Map
implements the job ID => job data mapping. -
State
gathers the two in a single data type -
Monad
offers some interface and operations that can work in any monad that has a job environment of sorts -
API
offers an HTTP interface to all of this that is API-compatible withservant-job
's async stuffs.
This patch changes all uses of servant-job's serveJobsAPI
to the new queue system's serveJobsAPI
, which is almost identical: it just takes as additional argument the job type.
This system also comes with a modest but useful-starting-point test suite that looks at basic properties.
PS: I'm also removing gargantext-client
, it's just too painfully slow to even load in ghci, let alone compile. I'll resurrect it if we need it some day, but let's not weight ourselves down until then.
@anoe Could you give a shot at using this branch to see how it goes? Feel free to go crazy and spawn a bunch of stuffs.