xqute.xqute
class
xqute.xqute.
Xqute
(
scheduler='local'
, plugins=None
, workdir='./.xqute'
, submission_batch=8
, error_strategy='ignore'
, num_retries=3
, forks=1
, scheduler_opts=None
, jobname_prefix=None
)
The main class of the package
Attributes
EMPTY_BUFFER_SLEEP_TIME
— The time to sleep while waiting whenthe buffer is empty to wait for the jobs to be pushed_cancelling
— A mark to mark whether a shutting down eventis triggered (True for natural cancelling, the signal for cancelling with a signal, SIGINT for example)buffer_queue
— A buffer queue to save the pushed jobsjobs
— The jobs registryname
— The name, used in loggerplugins
— 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 shouldqueue
— The job queuescheduler
— The schedulertask
— The task of producer and consumers
Parameters
scheduler
(str | Type[Scheduler], optional) — The scheduler class or nameplugins
(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 shouldworkdir
(str | PathType, optional) — The job meta directorysubmission_batch
(int, optional) — The number of consumers to submit jobs. So that thesubmission process won't exhaust the local resourceserror_strategy
(str, optional) — The strategy when there is error happenednum_retries
(int, optional) — Max number of retries when error_strategy is retryforks
(int, optional) — Max number of job forks for schedulerscheduler_opts
(Optional, optional) — Additional keyword arguments for scheduler
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
(CommandType | Job) — The command
method
run_until_complete
(
)
Wait until all jobs complete