-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add functionality to start and shutdown grpc client workers from iovironment #78
Conversation
69c4e04
to
9ebf4df
Compare
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #78 +/- ##
==========================================
- Coverage 45.55% 45.50% -0.05%
==========================================
Files 53 53
Lines 3956 3958 +2
Branches 472 472
==========================================
- Hits 1802 1801 -1
- Misses 2024 2026 +2
- Partials 130 131 +1 ☔ View full report in Codecov by Sentry. |
How does this integrate with nuraft_mesg which doesn't use iomanager? |
Two ways:
|
I'm trying to think of a way that nuraft_mesg can present the fact that starting and stopping the client workers is a requirement of the consumer of nuraft_mesg. I don't think it performing half the job is a great pattern (as in option 2). So maybe we can just assert in the nuraft_mesg::init code in the event that the workers haven't been started yet? That would make it clear that the responsibility is on the user of the library. |
@@ -75,6 +77,11 @@ IOEnvironment& IOEnvironment::with_object_manager() { | |||
return get_instance(); | |||
} | |||
|
|||
IOEnvironment& IOEnvironment::with_grpc_client_workers(std::string const& name, uint32_t const num_workers) { | |||
sisl::GrpcAsyncClientWorker::create_worker(name, num_workers); | |||
return get_instance(); |
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.
What are all these get_instance()
calls? Why not just *this
like normal? This is a member function, *this
is the singleton...
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.
You are right. I started returning get_instance when I first wrote this and am following it for continuity
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.
lg in general 👍
I like the idea of nuraft_mesg asserting and not doing the half work. |
No description provided.