Skip to content

remove --eager-loader/--lazy-loader options #4718

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

Merged
merged 1 commit into from
Aug 1, 2022
Merged

Conversation

davidism
Copy link
Member

@davidism davidism commented Aug 1, 2022

closes #4715

@davidism davidism added the cli label Aug 1, 2022
@davidism davidism added this to the 2.2.0 milestone Aug 1, 2022
@davidism davidism force-pushed the remove-lazy-option branch 2 times, most recently from 9f886cf to fff547c Compare August 1, 2022 16:30
Remove the `--eager-loading/--lazy-loading` options and the
`DispatchingApp` middleware. The `run` command handles loading
exceptions directly. The reloader always prints out tracebacks
immediately and always defers raising the error.
@davidism davidism force-pushed the remove-lazy-option branch from fff547c to 5d8e356 Compare August 1, 2022 17:37
@davidism
Copy link
Member Author

davidism commented Aug 1, 2022

I realized that the previous lazy implementation using the DispatchingApp middleware was unnecessarily complicated. Instead, the run command can always try/except loading the app, and then either re-raise the error immediately or create an app callable that will raise it later. There doesn't appear to be a reason to use threads and locks to do this.

When using the reloader, tracebacks can be printed immediately while also deferring raising them. This makes the error immediately visible in the terminal without needing to access the app again.

@davidism davidism merged commit 633f421 into main Aug 1, 2022
@davidism davidism deleted the remove-lazy-option branch August 1, 2022 17:44
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remove ability to toggle lazy/eager loading
1 participant