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

API to define a number of workers #2701

Merged
merged 4 commits into from
Mar 15, 2023
Merged

API to define a number of workers #2701

merged 4 commits into from
Mar 15, 2023

Conversation

ahopkins
Copy link
Member

@ahopkins ahopkins commented Mar 1, 2023

This PR adds a relatively small change to add a workers param to the manager so that it is easier to spin up multiple custom workers.

@app.main_process_ready
async def ready(app: Sanic, _):
    app.manager.manage(..., workers=3)

@ahopkins ahopkins requested a review from a team as a code owner March 1, 2023 22:51
@codecov
Copy link

codecov bot commented Mar 1, 2023

Codecov Report

Patch coverage: 100.000% and project coverage change: +0.106 🎉

Comparison is base (88c918e) 88.539% compared to head (e266d66) 88.646%.

❗ Current head e266d66 differs from pull request most recent head e050111. Consider uploading reports for the commit e050111 to get more accurate results

Additional details and impacted files
@@              Coverage Diff              @@
##              main     #2701       +/-   ##
=============================================
+ Coverage   88.539%   88.646%   +0.106%     
=============================================
  Files           87        87               
  Lines         6815      6817        +2     
  Branches      1171      1172        +1     
=============================================
+ Hits          6034      6043        +9     
+ Misses         537       533        -4     
+ Partials       244       241        -3     
Impacted Files Coverage Δ
sanic/worker/manager.py 94.047% <100.000%> (ø)
sanic/worker/process.py 89.285% <100.000%> (+0.194%) ⬆️

... and 2 files with indirect coverage changes

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 in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@Tronic Tronic left a comment

Choose a reason for hiding this comment

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

LGTM

@ahopkins ahopkins merged commit d62a92f into main Mar 15, 2023
@ahopkins ahopkins deleted the numbered-managed-workers branch March 15, 2023 14:02
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.

2 participants