Skip to content

Refactor task-to-call conversion #30

@jacob720

Description

@jacob720

From discussion with @DominicOram about making the queue service as generic as possible:

The queue service currently is set up for converting experiment definitions into blueapi calls. However, the way this conversion works will need to change depending on what else is in the queue. For example, an experiment may require a calibration scan to be ran before it. However, without knowledge of what else is in the queue, the same calibration scan may be queued up multiple times for different experiments that could actually share the same calibration data.

To solve this, the conversion step should actually be from an entire queue of tasks (and maybe history) to a queue of blueapi calls. We now have two queues:

  • Task Queue - should be manipulatable by a beamline scientist
  • Call Queue - only able to be mutated/created by the conversion function - and it's this queue that provides to a get_next_thing endpoint called by the worker (or external service Pull the queue worker into a seperate service #17)

Every time anything changes in the Task Queue (things added, deleted moved), the conversion will need to be re-calculated. Any time get_next_thing is called, the conversion should be re-calculated, as current conditions on the beamline may inform the conversion function.

Acceptance Criteria

  • Converter functions take the entire queue and history as inputs, and outputs a queue of blueapi calls
  • The conversion is ran whenever anything about the queue changes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions