Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for cleanup (0.19 sec)

  1. docs/em/docs/tutorial/dependencies/dependencies-with-yield.md

    # 🔗 ⏮️ 🌾
    
    FastAPI 🐕‍🦺 🔗 👈 <abbr title='sometimes also called "exit", "cleanup", "teardown", "close", "context managers", ...'>➕ 🔁 ⏮️ 🏁</abbr>.
    
    👉, ⚙️ `yield` ↩️ `return`, &amp; ✍ ➕ 🔁 ⏮️.
    
    !!! tip
        ⚒ 💭 ⚙️ `yield` 1️⃣ 👁 🕰.
    
    !!! note "📡 ℹ"
        🙆 🔢 👈 ☑ ⚙️ ⏮️:
    
        * <a href="https://docs.python.org/3/library/contextlib.html#contextlib.contextmanager" class="external-link" target="_blank">`@contextlib.contextmanager`</a> ⚖️
    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)
  2. docs/en/docs/advanced/generate-clients.md

    But for the generated client we could **modify** the OpenAPI operation IDs right before generating the clients, just to make those method names nicer and **cleaner**.
    
    We could download the OpenAPI JSON to a file `openapi.json` and then we could **remove that prefixed tag** with a script like this:
    
    === "Python"
    
        ```Python
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  3. docs/zh/docs/tutorial/dependencies/dependencies-with-yield.md

    # 使用yield的依赖项
    
    FastAPI支持在完成后执行一些<abbr title='有时也被称为“退出”("exit"),“清理”("cleanup"),“拆卸”("teardown"),“关闭”("close"),“上下文管理器”("context managers")。 ...'>额外步骤</abbr>的依赖项.
    
    为此,请使用 `yield` 而不是 `return`,然后再编写额外的步骤(代码)。
    
    !!! tip "提示"
        确保只使用一次 `yield` 。
    
    !!! note "技术细节"
    
        任何一个可以与以下内容一起使用的函数:
    
        * <a href="https://docs.python.org/3/library/contextlib.html#contextlib.contextmanager" class="external-link" target="_blank">`@contextlib.contextmanager`</a> 或者
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 10.3K bytes
    - Viewed (0)
  4. docs/ja/docs/tutorial/dependencies/dependencies-with-yield.md

    # yieldを持つ依存関係
    
    FastAPIは、いくつかの<abbr title='時々"exit"、"cleanup"、"teardown"、"close"、"context managers"、 ...のように呼ばれる'>終了後の追加のステップ</abbr>を行う依存関係をサポートしています。
    
    これを行うには、`return`の代わりに`yield`を使い、その後に追加のステップを書きます。
    
    !!! tip "豆知識"
        `yield`は必ず一度だけ使用するようにしてください。
    
    !!! info "情報"
        これを動作させるには、**Python 3.7** 以上を使用するか、**Python 3.6** では"backports"をインストールする必要があります:
    
        ```
        pip install async-exit-stack async-generator
        ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 12.5K bytes
    - Viewed (0)
  5. docs/en/docs/release-notes.md

    ```Python
    async def do_something():
        try:
            yield something
        finally:
            some_cleanup()
    ```
    
    ...that way the `finally` block is run regardless of any exception that might happen.
    
    ### Features
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri May 03 23:25:42 GMT 2024
    - 388.1K bytes
    - Viewed (1)
  6. docs/en/docs/async.md

    So, to balance that out, imagine the following short story:
    
    > You have to clean a big, dirty house.
    
    *Yep, that's the whole story*.
    
    ---
    
    There's no waiting 🕙 anywhere, just a lot of work to be done, on multiple places of the house.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 23K bytes
    - Viewed (0)
  7. docs/en/docs/advanced/events.md

    This can be very useful for setting up **resources** that you need to use for the whole app, and that are **shared** among requests, and/or that you need to **clean up** afterwards. For example, a database connection pool, or loading a shared machine learning model.
    
    ## Use Case
    
    Let's start with an example **use case** and then see how to solve it with this.
    
    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)
Back to top