refactor(protocol-engine): Rename stop() and pause() -> request_stop() and request_pause() #14879
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This fixes something that keeps confusing me as I work on EXEC-382.
Various things state that
ProtocolEngine.stop()
takes effect immediately—meaning, to me, that the robot's motion is stopped immediately, the protocol exits immediately, and the HTTP run is marked asstopped
immediately. This does not seem true. It merely puts the run into astop-requested
state, which only later settles into astopped
state.This PR adjusts some docstrings and renames
stop()
tostop_soon()
request_stop()
.The namestop_soon()
is inspired by asyncio and anyio'scall_soon()
.pause()
has the same caveat, so it's renamed torequest_pause()
for consistency.Test plan
None needed.
Review requests
Taking for granted, for a moment, that theDone.ProtocolEngine
interface has to work like this: isstop_soon()
a good name? Mayberequest_stop()
would be better?Done.pause()
has the same caveat. Do we want to rename that too, for consistency?Risk assessment
No risk.