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>
mum4k
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
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
SignalHandlerclass.Preparation for #280
Signed-off-by: Otto van der Schaaf oschaaf@we-amp.com