-
Notifications
You must be signed in to change notification settings - Fork 84
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
Extract SignalHandler class for re-use #282
Conversation
In preparation of sharing functionality for signal handling, extract what we have right now into SignalHandler. Status: draft For fixing envoyproxy#280 Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
@mum4k requesting early feedback on this; this extracts our signal handling code from
Would it make sense to shoot for landing this as-is? |
…ndler Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
…ndler Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
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 is a definitive improvement and we should be able to merge it in after addressing a few nits.
|
||
namespace Nighthawk { | ||
|
||
using SignalCallback = std::function<void()>; |
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.
Since this is part of the header - can we document it?
|
||
using SignalCallback = std::function<void()>; | ||
|
||
class SignalHandler final : public Envoy::Logger::Loggable<Envoy::Logger::Id::main> { |
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.
Let's also add documentation for the class including an example of usage.
|
||
class SignalHandler final : public Envoy::Logger::Loggable<Envoy::Logger::Id::main> { | ||
public: | ||
SignalHandler(const SignalCallback& signal_callback); |
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.
Can we add documentation for the constructor?
class SignalHandler final : public Envoy::Logger::Loggable<Envoy::Logger::Id::main> { | ||
public: | ||
SignalHandler(const SignalCallback& signal_callback); | ||
SignalHandler(SignalHandler const&) = delete; |
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.
Can we add a single comment above these two to indicate the intention, something like:
// Not copyable or movable.
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
In preparation of sharing functionality for signal handling,
extract what we have right now into a
SignalHandler
class.Preparation for #280
Signed-off-by: Otto van der Schaaf oschaaf@we-amp.com