DiamondLightSource / DiamondLightSource/blueapi
Enable adaptive plans to re-use the existing connection to the message bus
- Dominant language
- Python
- Stars
- 13
- Forks
- 13
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 25
Description
When writing adaptive plans, the plan must be able to consume information from outside of the process: e.g. consuming documents emitted by a workflow in the workflow manager.
The RunEngine must manage all of the IO into the plan, so we require a modification of our instance of the RunEngine to enable this.
This will take the form of a new command on the RunEngine, and a verb that can be passed in a message to execute the command and return an object that can be used in this way.
We should take care to encapsulate the behaviours that we do not want to expose, e.g. make queues exclusive where possible.
```python
c: ConnectionListener = yield Msg("listen", "queueName", MessageType)?
# or
m: MessageType = yield Msg("listen", "queueName", MessageType)?
# or
g: Generator[Msg] = yield Msg("listen", Callable[[MessageType], Msg])?
```
The form of the Msg must be documented
## Acceptance Criteria
- Plans can be written that rely on listening to external queues for input
- The way to write these plans has been documented
Contributor guide
Assessment
This issue has not been assessed yet.