-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
allow creation of multiple engines on the same protocol and port #419
Conversation
…viding a Stop on the specific engine
e62f3d9
to
4b47ab6
Compare
Sorry for the delay. I think we should mark |
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.
Please add // Deprecated:
on gnet.Stop()
Sure, and will fix the the test issue. |
…tops the last engine registered.
Codecov ReportBase: 71.26% // Head: 71.23% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## dev #419 +/- ##
==========================================
- Coverage 71.26% 71.23% -0.03%
==========================================
Files 13 13
Lines 1392 1408 +16
==========================================
+ Hits 992 1003 +11
- Misses 328 332 +4
- Partials 72 73 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Thanks~ |
…jf2000#419) Co-authored-by: Jeffrey Damick <jdamick@amazon.com>
name: Pull request
about: Currently with the allEngines global map multiple engines can't be created for the same protocol and port. If they are then there is no way to Stop the first engine since any subsequent engines will overwrite the entry in the allEngines map. Changing this map and the behavior of the gnet.Stop() is a bigger change so I merely added a Stop(..) function to the Engine so that it could Stopped and not leak.
title: ''
labels: ''
assignees: ''
1. Are you opening this pull request for bug-fixes, optimizations or new feature?
Yes.
2. Please describe how these code changes achieve your intention.
Currently with the allEngines global map multiple engines can't be created for the same protocol and port. If they are then there is no way to Stop the first engine since any subsequent engines will overwrite the entry in the allEngines map. Changing this map and the behavior of the gnet.Stop() is a bigger change so I merely added a Stop(..) function to the Engine so that it could Stopped and not leak.
Why enable multiple engines for the same protocol & port?
When using ReuseAddr and ReusePort then it's possible to swap in a new engine to the same address & port and disable the old one without incurring a restart of the server. This is the use case I currently have and would like to enable.
3. Please link to the relevant issues (if any).
4. Which documentation changes (if any) need to be made/updated because of this PR?
Documentation for Engine.Stop(..)
4. Checklist
I'm happy to add documentation to the README, just let me know if and where it makes sense?