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

Sanic multi-application server #2347

Merged
merged 48 commits into from Jan 16, 2022
Merged

Sanic multi-application server #2347

merged 48 commits into from Jan 16, 2022

Conversation

ahopkins
Copy link
Member

@ahopkins ahopkins commented Jan 2, 2022

Implementation of #2348

app.prepare(port=9999, debug=True)
app.prepare(port=9998)
app.prepare(port=9997)
app2.prepare(port=8888)
app2.prepare(port=8887)

Sanic.serve()

Requires #2362

BREAKING CHANGES 🚨

  • Removes GunicornWorker completely without a deprecation period

SIDE EFFECTS 🧁

NOTES 📝

  • auto_reload will be enabled if ANY of the applications are prepared with it on
  • workers are bound by the primary application (the first one prepared)

@codecov
Copy link

codecov bot commented Jan 9, 2022

Codecov Report

Merging #2347 (14fbe97) into main (8dfa49b) will increase coverage by 0.909%.
The diff coverage is 94.237%.

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #2347       +/-   ##
=============================================
+ Coverage   86.248%   87.157%   +0.909%     
=============================================
  Files           60        60               
  Lines         5003      4999        -4     
  Branches       896       904        +8     
=============================================
+ Hits          4315      4357       +42     
+ Misses         502       471       -31     
+ Partials       186       171       -15     
Impacted Files Coverage Δ
sanic/request.py 96.187% <ø> (ø)
sanic/server/protocols/base_protocol.py 65.384% <ø> (+1.634%) ⬆️
sanic/server/protocols/http_protocol.py 88.095% <ø> (+4.374%) ⬆️
sanic/server/protocols/websocket_protocol.py 70.312% <ø> (+2.130%) ⬆️
sanic/app.py 88.910% <72.222%> (+2.273%) ⬆️
sanic/mixins/runner.py 94.893% <94.893%> (ø)
sanic/application/state.py 96.103% <100.000%> (+3.121%) ⬆️
sanic/models/server_types.py 97.297% <100.000%> (+0.075%) ⬆️
sanic/server/runners.py 90.370% <100.000%> (ø)
sanic/touchup/schemes/ode.py 93.846% <100.000%> (-0.032%) ⬇️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a416e1...14fbe97. Read the comment docs.

@ahopkins ahopkins marked this pull request as ready for review January 12, 2022 09:20
@ahopkins ahopkins requested review from a team as code owners January 12, 2022 09:20
@ahopkins ahopkins marked this pull request as draft January 12, 2022 09:22
@ahopkins ahopkins marked this pull request as ready for review January 12, 2022 10:45
@ahopkins ahopkins added the needs review the PR appears ready but requires a review label Jan 13, 2022
Copy link
Member

@vltr vltr left a comment

Choose a reason for hiding this comment

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

I think this will be awesome, a huge step forward the right direction! 😎

@ahopkins ahopkins merged commit b8d9914 into main Jan 16, 2022
@ahopkins ahopkins deleted the multi-serve branch January 16, 2022 07:03
ChihweiLHBird pushed a commit to ChihweiLHBird/sanic that referenced this pull request Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking needs review the PR appears ready but requires a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants