-
Notifications
You must be signed in to change notification settings - Fork 1k
#84: Stop Asynchronous Server #243
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
Conversation
Calling this helper function will kill the main thread
|
@dhoomakethu , changed the base to |
pymodbus/server/async.py
Outdated
| reactor.stop() | ||
| else: | ||
| reactor.callFromThread(reactor.stop) | ||
| _logger.debug("Stopping main thread") |
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.
@rahulraghu94 This log message will be displayed irrespective of whether the current thread is main or child.
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.
Isn't that expected behaviour?
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.
Oh, sorry. I'm on some meds 📦
Fixing...
pymodbus/server/async.py
Outdated
| reactor.run() | ||
|
|
||
|
|
||
| def _stop_server(is_mainthread=True): |
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.
THe param is_mainthread=True is not being used, remove it if unnecessary
* New helper function to help stop Asynchronous server are being added. Calling this helper function will kill the main thread * pymodbus-dev#84: Removing redundant parameters to method _is_main_thread * pymodbus-dev#84: Fixed loggers * pymodbus-dev#84: Retaining one generic StopServer command that will cater to both TCP and Seriel Server * pymodbus-dev#84 Add docuementation to StopServer helper function
* New helper function to help stop Asynchronous server are being added. Calling this helper function will kill the main thread * #84: Removing redundant parameters to method _is_main_thread * #84: Fixed loggers * #84: Retaining one generic StopServer command that will cater to both TCP and Seriel Server * #84 Add docuementation to StopServer helper function
New helper function to help stop Asynchronous server are being added.
Calling this helper function will kill the main thread