Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(protocol-engine): Rename stop() and pause() -> request_stop() and request_pause() #14879

Merged
merged 3 commits into from
Apr 12, 2024

Conversation

SyntaxColoring
Copy link
Contributor

@SyntaxColoring SyntaxColoring commented Apr 11, 2024

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 as stopped immediately. This does not seem true. It merely puts the run into a stop-requested state, which only later settles into a stopped state.

This PR adjusts some docstrings and renames stop() to stop_soon() request_stop(). The name stop_soon() is inspired by asyncio and anyio's call_soon(). pause() has the same caveat, so it's renamed to request_pause() for consistency.

Test plan

None needed.

Review requests

  • Taking for granted, for a moment, that the ProtocolEngine interface has to work like this: is stop_soon() a good name? Maybe request_stop() would be better? Done.
  • pause() has the same caveat. Do we want to rename that too, for consistency? Done.

Risk assessment

No risk.

This is to reflect the apparent reality of what this method is doing.
@SyntaxColoring SyntaxColoring requested a review from a team as a code owner April 11, 2024 19:02
@SyntaxColoring SyntaxColoring requested review from a team April 11, 2024 19:02
@jbleon95
Copy link
Contributor

All in favor of the rename, though I'd personally prefer request_stop since I generally prefer verb_noun as function names rather than verb_adverb

Copy link
Contributor

@mjhuff mjhuff left a comment

Choose a reason for hiding this comment

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

I'm all for renaming pause to whatever is decided!

@SyntaxColoring SyntaxColoring changed the title refactor(protocol-engine): Rename stop() -> stop_soon() refactor(protocol-engine): Rename stop() and pause() -> request_stop() and request_pause() Apr 11, 2024
@SyntaxColoring SyntaxColoring merged commit 15782ad into edge Apr 12, 2024
20 checks passed
@SyntaxColoring SyntaxColoring deleted the rename_stop branch April 12, 2024 14:23
Carlos-fernandez pushed a commit that referenced this pull request May 20, 2024
…) and request_pause() (#14879)

# 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
as `stopped` immediately. This does not seem true. It merely puts the
run into a `stop-requested` state, which only later settles into a
`stopped` state.

This PR adjusts some docstrings and renames `stop()` to
~~`stop_soon()`~~ `request_stop()`. ~~The name `stop_soon()` is inspired
by asyncio and anyio's `call_soon()`.~~ `pause()` has the same caveat,
so it's renamed to `request_pause()` for consistency.

# Test plan

None needed.

# Review requests

* ~~Taking for granted, for a moment, that the `ProtocolEngine`
interface has to work like this: is `stop_soon()` a good name? Maybe
`request_stop()` would be better?~~ Done.
* ~~`pause()` has the same caveat. Do we want to rename that too, for
consistency?~~ Done.


# Risk assessment

No risk.
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.

None yet

4 participants