You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot run plans without a message bus (server) #426
Blueapi can start up without connecting to a message bus but fails to run any plans because the message bus is currently interconnected with the worker.
To Reproduce
Terminal 1
# start blueapi server
blueapi serve
Terminal 2
# Simple plan
blueapi controller run sleep '{"time": 5}'# More complex plan
blueapi controller run count '{"detectors": ["det"]}'
Possible solution
Make the message template an optional part of the handler and make it None if connection fails. Perform None-checks on it wherever it is used. Hopefully if its type is declared as optional in all the right places mypy should point out all the usages where it is assumed to be present.
Acceptance Criteria
Can run the demo set of plans without connecting blueapi to a message bus
Tests to prove that the message bus usages are guarded
In the Terminal 2 the example is given for the CLI which should raise exceptions when trying to run #427 (comment)
The blueapi server can run plans without a message bus and there are already tests to check it in the test_rest_api.py it uses a handler = Handler(context=context, messaging_template=MagicMock())
MagiMock which will run with a None as
We can see them working by the above change in the fixture of conftest.py
This test can be improved after we make progress on #360
There are tests added to check if the message bus use is guarded
Activity
[-]Cannot run plans without a message bus[/-][+]Cannot run plans without a message bus (server)[/+]ZohebShaikh commentedon Apr 26, 2024
In the Terminal 2 the example is given for the CLI which should raise exceptions when trying to run #427 (comment)
The blueapi server can run plans without a message bus and there are already tests to check it in the test_rest_api.py it uses a
handler = Handler(context=context, messaging_template=MagicMock())MagiMock which will run with a None as
We can see them working by the above change in the fixture of conftest.py
This test can be improved after we make progress on #360
There are tests added to check if the message bus use is guarded
The changes mentioned are in this PR: #433
Remove message bus dependency (#433)
Remove message bus dependency (#433)
Remove message bus dependency (#433)