QueuePlugin#
- class daq_queuing_service.plugins.converter.Converter[source]#
Bases:
object- validate(experiments: list[TaskRequest | Experiment]) None[source]#
This gets run on new experiments added to the queue through the api endpoint. Any error raised will be handled and cause the experiments to not be added to the queue.
- pre_process(current_task: TaskWithPosition | None, queue: list[Task], history: list[TaskWithPosition], call_history: list[BlueapiCallResponse]) list[Task][source]#
This gets run whenever something changes in the queue, before ‘construct_blueapi_calls’. It is an opportunity to automatically modify the queue based on it’s current state and history.
For example, it could be used to add calibration scans before any experiments that require them. It could also be used to query another service such as ulims and add experiments to the queue.
If not overridden, this method returns the queue as is with no modification.
- Parameters:
- Returns:
The new list of tasks in the queue
- Return type:
list[Task]
- construct_blueapi_calls(queue: list[TaskWithPosition], history: list[TaskWithPosition], call_history: list[BlueapiCallResponse]) list[BlueapiCall][source]#
Converts the list of queued tasks into a list of blueapi calls. This is needed if the queue contains ulims experiments, as these must be mapped onto bluesky plans. If the queue contains TaskRequests, they can just be wrapped into BlueapiCall objects with no conversion, as this default implementation does.
- pause_on_complete_blueapi_call(call: BlueapiCall, result: TaskResult) bool[source]#
Decide whether to pause the queue after a blueapi call completes successfully
- Parameters:
call (BlueapiCall) – The completed call
result (TaskResult) – The result of the call from blueapi
- Returns:
True to pause the queue, False to leave it running.
- Return type: