-
Notifications
You must be signed in to change notification settings - Fork 42
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
Import app factory before retrieving ioloop fix #156 #157
Conversation
Mention - I ran the tests, and I don't think I broke anything. One test was broken from before on py3.6.3 |
Codecov Report
@@ Coverage Diff @@
## master #157 +/- ##
==========================================
+ Coverage 94.9% 94.91% +<.01%
==========================================
Files 13 13
Lines 766 767 +1
Branches 93 93
==========================================
+ Hits 727 728 +1
Misses 25 25
Partials 14 14
Continue to review full report at Codecov.
|
Can you provide an example which demonstrates why this is necessary? My suspicion is that it's not required if your project is set up canonically, however I'm still prepared to make the change if it provides one less headache for users. "There's more than one way to skin a cat". |
@@ -109,6 +109,9 @@ def serve_main_app(config: Config, tty_path: Optional[str], loop: asyncio.Abstra | |||
with set_tty(tty_path): | |||
setup_logging(config.verbose) | |||
|
|||
# imports the factory. This gives users a chance to register alternative event loops | |||
config.app_factory |
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.
It's not your fault, but this looks dumb and isn't clear.
If we decide to merge this I think it would be better to remove the app_factory
property and rename _import_app_factory > import_app_factory
and use that instead.
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.
I agree that making that function public would be a better option. Want me to refactor the function?
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.
Also, regarding my problem, namely being able to set my own event loop, and not use the standard one - details are in the issue #156
There are no other details that I can provide - basically I don't know of a nice way to make the runserver
command use the event loop that I want.
If you can suggest a better way, that' fine. I haven't investigated that much, so I don't have an overview of the project's structure.
Until then, the problem remains valid, and both the traceback of the error, and the code that generated it can be found in the issue.
Thanks for your time! :)
I thought this had already been solved by #150. |
No description provided.