Skip to content

feat: Use websockets if stomp config not present - #1646

Merged
fajinyuan merged 8 commits into
mainfrom
scripting-ws
Oct 21, 2026
Merged

fajinyuan merged 8 commits into
mainfrom
scripting-ws

Conversation

@tpoliaw

@tpoliaw tpoliaw commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Update the client's run_task method to use stomp if the configuration is present
and fall back to the new websocket connection if not.

Allows the scripting interface (bc.plans.count(...)) to run without
configuration using websockets.

The CLI also defaults to websockets if no configuration is present. To force
stomp monitoring, a new --stomp flag is added to be paired with the --ws flag.

The previous run_task method on BlueapiClient has been renamed to run_stomp and
run_task will delegate to the correct method depending on the configuration
available. This should not be a breaking change as there is no change in
behaviour if configuration is present.

@tpoliaw
tpoliaw requested a review from a team as a code owner August 27, 2026 16:37
@codecov

codecov Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.43%. Comparing base (66b52cc) to head (239e7aa).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1646      +/-   ##
==========================================
+ Coverage   96.41%   96.43%   +0.01%     
==========================================
  Files          49       49              
  Lines        3711     3728      +17     
==========================================
+ Hits         3578     3595      +17     
  Misses        133      133              

☔ 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 tpoliaw changed the title Merge run_task handling feat: Use websockets if stomp config not present Sep 2, 2026
@tpoliaw tpoliaw linked an issue Sep 2, 2026 that may be closed by this pull request
return cls(rest)

@classmethod
def for_host(cls, host: str | None = None) -> Self:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this should be called. for_host doesn't make sense when called as for_host() to use the default.

@ZohebShaikh

Copy link
Copy Markdown
Contributor

@tpoliaw Are you working secretly 😄 ?

@fajinyuan
fajinyuan added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit e96a9c5 Oct 21, 2026
20 checks passed
@fajinyuan
fajinyuan deleted the scripting-ws branch October 21, 2026 13:22
ZohebShaikh pushed a commit that referenced this pull request Nov 2, 2026
Update the client's run_task method to use stomp if the configuration is
present
and fall back to the new websocket connection if not.

Allows the scripting interface (bc.plans.count(...)) to run without
configuration using websockets.

The CLI also defaults to websockets if no configuration is present. To
force
stomp monitoring, a new --stomp flag is added to be paired with the --ws
flag.

The previous run_task method on BlueapiClient has been renamed to
run_stomp and
run_task will delegate to the correct method depending on the
configuration
available. This should not be a breaking change as there is no change in
behaviour if configuration is present.

---------

Co-authored-by: Dr Fajin Yuan <fajin.yuan@diamond.ac.uk>
ZohebShaikh pushed a commit that referenced this pull request Nov 2, 2026
Update the client's run_task method to use stomp if the configuration is
present
and fall back to the new websocket connection if not.

Allows the scripting interface (bc.plans.count(...)) to run without
configuration using websockets.

The CLI also defaults to websockets if no configuration is present. To
force
stomp monitoring, a new --stomp flag is added to be paired with the --ws
flag.

The previous run_task method on BlueapiClient has been renamed to
run_stomp and
run_task will delegate to the correct method depending on the
configuration
available. This should not be a breaking change as there is no change in
behaviour if configuration is present.

---------

Co-authored-by: Dr Fajin Yuan <fajin.yuan@diamond.ac.uk>
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.

Support websocket connection in scripting interface

3 participants