Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for Raines (0.14 sec)

  1. docs/de/docs/advanced/events.md

    Sie können diese Logik beim *Hochfahren* und *Herunterfahren* mithilfe des `lifespan`-Parameters der `FastAPI`-App und eines „Kontextmanagers“ definieren (ich zeige Ihnen gleich, was das ist).
    
    Beginnen wir mit einem Beispiel und sehen es uns dann im Detail an.
    
    Wir erstellen eine asynchrone Funktion `lifespan()` mit `yield` wie folgt:
    
    ```Python hl_lines="16  19"
    {!../../../docs_src/events/tutorial003.py!}
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:30:59 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  2. docs/pt/docs/advanced/events.md

    Vamos iniciar com um exemplo e ver isso detalhadamente.
    
    Nós criamos uma função assíncrona chamada `lifespan()` com `yield` como este:
    
    ```Python hl_lines="16  19"
    {!../../../docs_src/events/tutorial003.py!}
    ```
    
    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

    Let's start with an example and then see it in detail.
    
    We create an async function `lifespan()` with `yield` like this:
    
    ```Python hl_lines="16  19"
    {!../../../docs_src/events/tutorial003.py!}
    ```
    
    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

    ## `startup` 事件
    
    使用 `startup` 事件声明 `app` 启动前运行的函数:
    
    ```Python hl_lines="8"
    {!../../../docs_src/events/tutorial001.py!}
    ```
    
    本例中,`startup` 事件处理器函数为项目数据库(只是**字典**)提供了一些初始值。
    
    **FastAPI** 支持多个事件处理器函数。
    
    只有所有 `startup` 事件处理器运行完毕,**FastAPI** 应用才开始接收请求。
    
    ## `shutdown` 事件
    
    使用 `shutdown` 事件声明 `app` 关闭时运行的函数:
    
    ```Python hl_lines="6"
    {!../../../docs_src/events/tutorial002.py!}
    ```
    
    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)
  5. docs/ko/docs/advanced/events.md

    ```Python hl_lines="8"
    {!../../../docs_src/events/tutorial001.py!}
    ```
    
    이 경우 `startup` 이벤트 핸들러 함수는 단순히 몇 가지 값으로 구성된 `dict` 형식의 "데이터베이스"를 초기화합니다.
    
    하나 이상의 이벤트 핸들러 함수를 추가할 수도 있습니다.
    
    그리고 응용 프로그램은 모든 `startup` 이벤트 핸들러가 완료될 때까지 요청을 받지 않습니다.
    
    ## `shutdown` 이벤트
    
    응용 프로그램이 종료될 때 실행하려는 함수를 추가하려면 `"shutdown"` 이벤트로 선언합니다:
    
    ```Python hl_lines="6"
    {!../../../docs_src/events/tutorial002.py!}
    ```
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 22:35:55 GMT 2024
    - 2.2K bytes
    - Viewed (0)
Back to top