From d63475bb7dd0d5d74dc3d67f037fc095ca1d197b Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 14 Jun 2020 12:25:10 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Mention=20in=20docs=20that=20sub?= =?UTF-8?q?apps=20don't=20fire=20events=20(#1554)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastián Ramírez --- docs/en/docs/advanced/events.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/en/docs/advanced/events.md b/docs/en/docs/advanced/events.md index 8b3dc7af1..7cd2998f0 100644 --- a/docs/en/docs/advanced/events.md +++ b/docs/en/docs/advanced/events.md @@ -4,6 +4,9 @@ You can define event handlers (functions) that need to be executed before the ap These functions can be declared with `async def` or normal `def`. +!!! warning + Only event handlers for the main application will be executed, not for [Sub Applications - Mounts](./sub-applications.md){.internal-link target=_blank}. + ## `startup` event To add a function that should be run before the application starts, declare it with the event `"startup"`: @@ -41,4 +44,4 @@ Here, the `shutdown` event handler function will write a text line `"Application So, we declare the event handler function with standard `def` instead of `async def`. !!! info - You can read more about these event handlers in Starlette's Events' docs. \ No newline at end of file + You can read more about these event handlers in Starlette's Events' docs.