Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for Sub (0.13 sec)

  1. docs/em/docs/advanced/events.md

    ## 🎧 🈸
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  2. docs/pt/docs/advanced/events.md

        Incluindo como manipular estado do lifespan que pode ser usado em outras áreas do seu código.
    
    ## Sub Aplicações
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8.6K bytes
    - Viewed (0)
  3. docs/en/docs/advanced/events.md

        Including how to handle lifespan state that can be used in other areas of your code.
    
    ## Sub Applications
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  4. docs/zh/docs/advanced/events.md

    # 事件:启动 - 关闭
    
    **FastAPI** 支持定义在应用启动前,或应用关闭后执行的事件处理器(函数)。
    
    事件函数既可以声明为异步函数(`async def`),也可以声明为普通函数(`def`)。
    
    !!! warning "警告"
    
        **FastAPI** 只执行主应用中的事件处理器,不执行[子应用 - 挂载](sub-applications.md){.internal-link target=_blank}中的事件处理器。
    
    ## `startup` 事件
    
    使用 `startup` 事件声明 `app` 启动前运行的函数:
    
    ```Python hl_lines="8"
    {!../../../docs_src/events/tutorial001.py!}
    ```
    
    本例中,`startup` 事件处理器函数为项目数据库(只是**字典**)提供了一些初始值。
    
    **FastAPI** 支持多个事件处理器函数。
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 1.7K bytes
    - Viewed (0)
Back to top