Skip to content

xqute.plugin

module

xqute.plugin

Hook specifications for scheduler plugins

Functions
function

xqute.plugin.on_init(xqute)

When xqute is initialized

Note that this hook will run at the same time when producer and consumer start. So they are not ensured to be started at this point.

Parameters
  • xqute (Xqute) The xqute object
function

xqute.plugin.on_shutdown(xqute, sig)

When xqute is shutting down

Return False to stop shutting down, but you have to shut it down by yourself, for example, xqute.task.cancel()

Only the first return value will be used.

Parameters
  • xqute (Xqute) The xqute object
  • sig (signal.signals | none) The signal. None means a natural shutdown
function

xqute.plugin.on_job_init(scheduler, job)

When the job is initialized

Parameters
  • scheduler (Scheduler) The scheduler object
  • job (Job) The job object
function

xqute.plugin.on_job_queued(scheduler, job)

When the job is queued

Parameters
  • scheduler (Scheduler) The scheduler object
  • job (Job) The job object
function

xqute.plugin.on_job_submitting(scheduler, job)

When the job is to be submitted

Return False to cancel submitting. Only the first return value is used.

Parameters
  • scheduler (Scheduler) The scheduler object
  • job (Job) The job object
function

xqute.plugin.on_job_submitted(scheduler, job)

When the job is submitted

Parameters
  • scheduler (Scheduler) The scheduler object
  • job (Job) The job object
function

xqute.plugin.on_job_started(scheduler, job)

When the job starts to run.

Note that this is not when exactly the job starts to run, but when the scheduler starts to wait for the job to finish. So this hook is not suitable for measuring the time of the job.

Parameters
  • scheduler (Scheduler) The scheduler object
  • job (Job) The job object
function

xqute.plugin.on_job_polling(scheduler, job)

When the system is polling job status

Parameters
  • scheduler (Scheduler) The scheduler object
  • job (Job) The job object
function

xqute.plugin.on_job_killing(scheduler, job)

When the job is being killed

Return False to stop killing the job.

Parameters
  • scheduler (Scheduler) The scheduler object
  • job (Job) The job object
function

xqute.plugin.on_job_killed(scheduler, job)

When the job is killed

Parameters
  • scheduler (Scheduler) The scheduler object
  • job (Job) The job object
function

xqute.plugin.on_job_failed(scheduler, job)

When the job is failed

Parameters
  • scheduler (Scheduler) The scheduler object
  • job (Job) The job object
function

xqute.plugin.on_job_succeeded(scheduler, job)

When the job is succeeded

Parameters
  • scheduler (Scheduler) The scheduler object
  • job (Job) The job object