GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — set_loop for app check, allow app_factory() by samuelcolvin · Pull Request #96 · aio-libs/aiohttp-devtools

Conversation

@samuelcolvin

@samuelcolvin samuelcolvin commented Jun 28, 2017

Copy link
Copy Markdown
Member

fixes #88.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
samuelcolvin added 2 commits June 28, 2017 10:27
@samuelcolvin
set_loop for app check, allow app_factory()
f9b3f6f
@samuelcolvin
history and uprev
bdc2351
@samuelcolvin samuelcolvin mentioned this pull request Jun 28, 2017
app.loop is not defined during pre-check #88
Closed
@asvetlov

asvetlov commented Jun 28, 2017

Copy link
Copy Markdown
Member

Would you accept coroutine as app_factory?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@samuelcolvin

samuelcolvin commented Jun 28, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Easy enough to do.

I'm not sure how that would work when running the code in production. Eg. Gunicorn doesn't accept a coroutine, and if you're using web.run_app(), you'd have to do something ugly with loop.run_until_complete.

Why would a coroutine be useful? surely anything requiring a running loop can be done in startup coroutines?

Perhaps having app_factory as a coroutine could encourage people to setup their app in a way which will be hard to deploy?

Very happy to add the functionality if it's useful.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@samuelcolvin
fix linting and tests
ac7bb7d
@codecov

codecov Bot commented Jun 28, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

Merging #96 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #96      +/-   ##
=========================================
+ Coverage   95.06%   95.1%   +0.03%     
=========================================
  Files          12      12              
  Lines         770     776       +6     
  Branches       92      92              
=========================================
+ Hits          732     738       +6     
  Misses         26      26              
  Partials       12      12
Impacted Files Coverage Δ
aiohttp_devtools/cli.py 100% <ø> (ø) ⬆️
aiohttp_devtools/runserver/serve.py 93.27% <100%> (-0.06%) ⬇️
aiohttp_devtools/runserver/config.py 88.28% <100%> (+0.78%) ⬆️
aiohttp_devtools/version.py 100% <100%> (ø) ⬆️

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 70aef40...ac7bb7d. Read the comment docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@asvetlov

asvetlov commented Jun 28, 2017

Copy link
Copy Markdown
Member

Well, let's discuss.
My main motivation is creating every async object (the object that should cooperate with asyncio loop) inside a coroutine.
It allows to skip explicit event loop passing but get implicit running loop used for coro execution.
Maybe we end up with something like run_forever() from python/asyncio#465
I still don't know how to better integrate this approach with gunicorn.
We could add support for coroutine factory to aiohttp.worker easy though.
And after that got smoothly to dropping ._init_loop() trick at all.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@samuelcolvin

samuelcolvin commented Jul 1, 2017

Copy link
Copy Markdown
Member Author

Let's leave the coroutine question for now. Happy to add it later if it's needed.

asvetlov reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@samuelcolvin
samuelcolvin merged commit 7ce8a6e into master Jul 1, 2017
@samuelcolvin
samuelcolvin deleted the check-loop branch July 1, 2017 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

app.loop is not defined during pre-check

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@samuelcolvin @asvetlov
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.