gws.base.job.manager

Job manager.

Source code: gws.base.job.manager

Module Contents

class gws.base.job.manager.Object

Bases: gws.JobManager

Job Manager.

dbPath: str
DDL = Multiline-String
Show Value
"""
        CREATE TABLE IF NOT EXISTS jobs (
            uid           TEXT NOT NULL PRIMARY KEY,
            userUid       TEXT DEFAULT '',
            userStr       TEXT DEFAULT '',
            worker        TEXT DEFAULT '',
            state         TEXT DEFAULT '',
            error         TEXT DEFAULT '',
            numSteps      INTEGER DEFAULT 0,
            step          INTEGER DEFAULT 0,
            stepName      TEXT DEFAULT '',
            payload       TEXT DEFAULT '',
            created       INTEGER DEFAULT 0,
            updated       INTEGER DEFAULT 0
        )
    """
TABLE = 'jobs'
cancel_job(job: gws.Job) gws.Job | None
configure()

Configuration hook.

create_job(user, worker, payload=None)
get_job(job_uid: str, user=None, state=None)
get_job_or_fail(job_uid: str, user=None, state=None)
handle_cancel_request(req, p)
handle_status_request(req, p)
job_status_response(job, **kwargs)
periodic_task()

Periodic task hook.

remove_job(job: gws.Job)
require_job(req, p)
run_job(job: gws.Job)
schedule_job(job: gws.Job)
update_job(job, **kwargs)