Skip to content
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

make server variable public #87

Closed
wants to merge 2 commits into from
Closed

Conversation

menta2k
Copy link

@menta2k menta2k commented Oct 7, 2020

The use case:
I have have a multiple instance of atreugo in single application. They have kind of dependency between each other.
I like to shutdown both instances gracefully using context with timeout in certain order. The only way to achieve this is to implement a custom graceful stop. To do that i need a direct access to fasthttp instance in atreugo structure or expose fasthttp shutdown function

@coveralls
Copy link

coveralls commented Oct 7, 2020

Pull Request Test Coverage Report for Build 473

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 470: 0.0%
Covered Lines: 709
Relevant Lines: 709

💛 - Coveralls

Copy link
Owner

@savsgio savsgio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And fix the linter error, please.

return s.server.Shutdown()
}
// Server return fasthttp server instance
func (s *Atreugo) Server() *fasthttp.Server {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you need the shutdown function only, i prefer to keep non public the internal fasthttp server instance. So please, remove it.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Menta2L

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants