Conversation
|
Rough next steps in no particular order
|
|
910d91b to
b5c01e6
Compare
71bdbcf to
2371239
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1413 +/- ##
==========================================
- Coverage 95.96% 95.92% -0.04%
==========================================
Files 45 46 +1
Lines 3317 3636 +319
==========================================
+ Hits 3183 3488 +305
- Misses 134 148 +14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
b5c32f7 to
40cbd59
Compare
9d061e9 to
b2936d4
Compare
| class Pause(BaseModel): | ||
| kind: Literal["pause"] = "pause" | ||
|
|
||
|
|
||
| class Resume(BaseModel): | ||
| kind: Literal["resume"] = "resume" | ||
|
|
||
|
|
||
| class Abort(BaseModel): | ||
| kind: Literal["abort"] = "abort" | ||
| reason: str | None = None |
There was a problem hiding this comment.
These aren't used at the moment. Cancelling from the client side will abort the plan on the server.
|
|
||
|
|
||
| @secure_router_v2.websocket("/run_plan") | ||
| async def run_plan( |
There was a problem hiding this comment.
I think this method should be refactored into its own class but for now I'd like to get something usable in before improving it in further PRs
|
Should probably have a way for plans run via the plan cache to use websockets. They currently default to using the existing message bus approach. Something like bc = BlueapiClient.from_config_file(...)
bc.use_ws(True)
bc.plans.count(detectors=[bc.devices.det])It's not ideal though so open to suggestions. A new client only config field? |
| self.handles = [] | ||
|
|
||
| def __enter__(self) -> EventStream: | ||
| tx, rx = Pipe() |
There was a problem hiding this comment.
Nit: maybe could you make the variable names rx, tx and hnd full form? Just for readability
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.
_ws_address doesn't count as a get method
Handle the path mangling in code instead of via URL constraints and Field annotations. Stops the type checking falling over
Using pydantic's dependency handling means they end up in the openapi schema even when auth is not being used.
| tx.send(worker_event) | ||
| except BrokenPipeError: | ||
| LOGGER.warning("Sending event to broken pipe") | ||
| pass |
| # * Submit task | ||
| # * Pause | ||
| # * Resume | ||
| # * Abort |
There was a problem hiding this comment.
one more use case - stop or abort after current point, ensure data collected so far are saved. like finish earlier!
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.