Closed RedTailedHawk closed 6 years ago
The serviceRequest method can be overridden to provide this functionality already, and is likely preferred to handle it in this manner rather than create a separate function to override. The AbstractService in general is not very useful - we have our own implementations of Service rather than extend AbstractService in order to get similar behavior of triggering events when requested to shutdown.
I just thought an overridable event would have been nicer than having to copy and paste the switch statement code from serviceRequest. But that approach is workable.
Thanks for looking at the pull request.
...and respond to a shutdown request on a thread other than main.
This allows my main thread to wait for a signal that the Windows service is shutting down, instead of polling and sleeping.
So instead of this:
This: