Skip to content

xqute.xqute

module

xqute.xqute

The xqute module

Classes
  • Xqute The main class of the package</>
class

xqute.xqute.Xqute(scheduler='local', plugins=None, job_metadir=PosixPath('.xqute'), job_submission_batch=8, job_error_strategy='ignore', job_num_retries=3, scheduler_forks=1, scheduler_prescript='', scheduler_postscript='', **scheduler_opts)

The main class of the package

Attributes
  • EMPTY_BUFFER_SLEEP_TIME The time to sleep while waiting whenthe buffer is empty
  • _cancelling A mark to mark whether a shutting down eventis triggered (True for natual cancelling, the signale for cancelling with a signal, SIGINT for example)
  • _job_error_strategy The strategy when there is error happened
  • _job_metadir The job meta directory
  • _job_num_retries The number of retries when strategy is retry
  • buffer_queue A buffer queue to save the pushed jobs
  • job_submission_batch The number of consumers to submit jobs
  • jobs The jobs registry
  • name The name, used in logger
  • plugins The plugins to be enabled or disabledto disable a plugin, using -plugin_name either all plugin names should be prefixed with '+'/'-' or none of them should
  • queue The job queue
  • scheduler The scheduler
  • task The task of producer and consumers
Parameters
  • scheduler (str | Type[Scheduler], optional) The scheduler class or name
  • plugins (Optional, optional) The plugins to be enabled or disabledto disable a plugin, using -plugin_name either all plugin names should be prefixed with '+'/'-' or none of them should To enabled plugins, objects are
  • job_metadir (PathLike, optional) The job meta directory
  • job_submission_batch (int, optional) The number of consumers to submit jobs
  • job_error_strategy (str, optional) The strategy when there is error happened
  • job_num_retries (int, optional) Max number of retries when job_error_strategy is retry
  • scheduler_forks (int, optional) Max number of job forks
  • **scheduler_opts Additional keyword arguments for scheduler
Methods
method

cancel(sig=None)

Cancel the producer-consumer task

self._cancelling will be set to signaled if sig is provided, otherwise it will be set to True

Parameters
  • sig (signal.signals | none, optional) Whether this cancelling is caused by a signal
method

put(cmd)

Put a command into the buffer

Parameters
  • cmd (Job | str | List[str]) The command
method

run_until_complete()

Wait until all jobs complete