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.
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
fix(robot-server): Refactor hardware wrapper and other lifetime dependencies #8213
fix(robot-server): Refactor hardware wrapper and other lifetime dependencies #8213
Changes from 10 commits
e77dd78
686b1fa
3e89b33
fca92e0
752fabb
656a100
0f2ea16
d7b29eb
bf04ca4
4dfa729
bf31cc0
e6bc2e4
ab183c3
3e0f901
e3eb9bd
9428465
6a33398
c389c36
7c62bf8
bcb6397
f2d54fb
e42916b
602eb75
0afd56a
c0dfca8
c818120
697e2fd
5ab454b
1aa55bd
6552b3c
774cfb4
3a95844
b6d95af
3b854b2
dc5032d
b7ac395
8827b2f
3573b80
59d46f3
615e06a
8d06237
abd5d19
72a47dd
1c8d3b9
84a6ff6
a960dd1
b3593da
233ef3d
5343b36
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Utilities" is always a bit of a warning sign for me. Something you need utilities, but if we have a hardware connection we need to initialize and hand out as a dependency, shouldn't those all be in the same place?
Is there a way we can restructure this PR to have
robot_server/hardware.py
be the thing that actually exports a startup / shutdown handler for the hardware along with theget_hardware
dependency function? I'm imagining a system where any given dependency is able to use classes / functions inlifetime_dependencies
to declare themselves a lifetime dependency.For example, if this module was to export 2 or 3 methods, I think everything would be a lot easier to follow:
def initialize_hardware(app_state: State) -> None
slow_initializing
and/orlifetime_dependencies
to attach it to app statelifetime_dependencies
def get_hardware(app_state: State) -> ThreadManager
def shutdown_hardware(app_state: State) -> None
lifetime_dependencies
centralized cleanup or notThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ The
publisher
value changed because it was previously based on the name of the containing class, which no longer exists.This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ This diff got weird. I suggest viewing this file in split mode.