gws.server.spool.runner

Queue and run background jobs with the uWSGI spooler.

Source code: gws.server.spool.runner

Module Contents

gws.server.spool.runner.add(job: gws.Job)

Queue a job for the spooler.

Parameters:

job – The job to queue. Only its uid is passed to the spooler.

gws.server.spool.runner.IGNORE = 0
gws.server.spool.runner.is_active()

Check whether the uWSGI spooler is available.

Returns:

True if the code runs in a uWSGI process.

gws.server.spool.runner.OK = -2
gws.server.spool.runner.RETRY = -1
gws.server.spool.runner.run(root: gws.Root, env: dict)

Run a queued job.

Logs an error if the job uid is missing or the job is not found.

Parameters:
  • root – Root object.

  • env – Spooler arguments, as passed by uWSGI, with the job uid in b'job_uid'.