-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define
web.Application.on_startup()
handler (#1103)
Changes: - Define `web.Application.on_startup()` signal handler. - Run `app.on_startup()` along with the request handler within an event loop in `web.run_app()`. - Tests for `Application.on_startup` signal - Tests for multiple tasks to run on startup, including two long running - Extend tests on `web.run_app()`: ensure that `Application.startup()` is called within `web.run_app()`. - Add documentation for `Application.on_startup` signal handler: - Describe possible use cases - Minor: fix typo Notes: In the `tests/test_run_app.py` increased delay for `loop.call_later` from `0.01s` to `0.02s` since with the old value loop used to stop before coroutines gathered for `on_startup` finished, that caused an exception.
- Loading branch information
Showing
5 changed files
with
152 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters