Skip to content

feat: Run blocking plans via websockets#1413

Draft
tpoliaw wants to merge 44 commits into
mainfrom
ws
Draft

feat: Run blocking plans via websockets#1413
tpoliaw wants to merge 44 commits into
mainfrom
ws

Conversation

@tpoliaw

@tpoliaw tpoliaw commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

As an intermediate step before (or instead of?) redesigning the server sub-process handling, we can add a websocket endpoint to run the same submit-listen-start approach that the client runs remotely.

@tpoliaw

tpoliaw commented Feb 25, 2026

Copy link
Copy Markdown
Contributor Author

Rough next steps in no particular order

  • Move websocket client method into BlueapiRestClient
  • Add wrapper method in BlueapiClient?
  • Add unstable/preview --ws flag to cli run method
  • Deal with auth. Browser websocket api can't set headers
  • Users + user-agents
  • Include data/progress events
  • Add service/meta events for error handling etc
  • Handle client aborting
  • Check interaction with server being busy
  • Wrap pipe/unpipe into something that doesn't need finally handling
  • See what happens when listeners fall over/slow down - do messages back up
  • Add middleware for debug logging

@abbiemery

Copy link
Copy Markdown
Contributor
  • store api url withouth scheme, and add scheme to http and ws calls respectively. (request_and_deserialise)

Comment thread src/blueapi/service/interface.py Outdated
Comment thread src/blueapi/service/interface.py Outdated
Comment thread src/blueapi/service/runner.py
@tpoliaw tpoliaw force-pushed the ws branch 2 times, most recently from 910d91b to b5c01e6 Compare March 12, 2026 16:41
@tpoliaw tpoliaw force-pushed the ws branch 2 times, most recently from 71bdbcf to 2371239 Compare April 14, 2026 15:28
Comment thread src/blueapi/service/interface.py Fixed
Comment thread src/blueapi/service/middleware.py Fixed
Comment thread src/blueapi/service/middleware.py Fixed
Comment thread src/blueapi/service/interface.py Dismissed
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 55.03597% with 125 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.51%. Comparing base (4c5b567) to head (935faaf).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/blueapi/service/main.py 17.64% 42 Missing ⚠️
src/blueapi/client/rest.py 32.43% 25 Missing ⚠️
src/blueapi/service/runner.py 42.85% 24 Missing ⚠️
src/blueapi/service/interface.py 42.30% 15 Missing ⚠️
src/blueapi/client/client.py 13.33% 13 Missing ⚠️
src/blueapi/worker/event.py 40.00% 3 Missing ⚠️
src/blueapi/service/protocol.py 94.59% 2 Missing ⚠️
src/blueapi/cli/cli.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1413      +/-   ##
==========================================
- Coverage   95.93%   92.51%   -3.43%     
==========================================
  Files          44       45       +1     
  Lines        3271     3525     +254     
==========================================
+ Hits         3138     3261     +123     
- Misses        133      264     +131     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

tpoliaw added 14 commits July 3, 2026 10:55
Allows error messages to be propagated correctly.
Saves converting messages is two steps
This is trying to mask a race condition that should be handled elsewhere.
If a task is started between the check and submission the task will still
be started. This adds a tiledwriter to the run_engine that will receive
messages from the exisiting plan and then fall over when it doesn't recognise
UUIDs. It might do for now though.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants