Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for cleanup (0.24 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8.6K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/dependencies/dependencies-with-yield.md

    # Dependencies with yield
    
    FastAPI supports dependencies that do some <abbr title='sometimes also called "exit code", "cleanup code", "teardown code", "closing code", "context manager exit code", etc.'>extra steps after finishing</abbr>.
    
    To do this, use `yield` instead of `return`, and write the extra steps (code) after.
    
    !!! tip
        Make sure to use `yield` one single time.
    
    !!! note "Technical Details"
        Any function that is valid to use with:
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  3. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Apr 28 00:28:00 GMT 2024
    - 385.5K bytes
    - Viewed (1)
  4. docs/ru/docs/tutorial/dependencies/dependencies-with-yield.md

    # Зависимости с yield
    
    FastAPI поддерживает зависимости, которые выполняют некоторые <abbr title='также известные как "exit", "cleanup", "teardown", "close", "context managers", ...'>дополнительные действия после завершения работы</abbr>.
    
    Для этого используйте `yield` вместо `return`, а дополнительный код напишите после него.
    
    !!! tip "Подсказка"
        Обязательно используйте `yield` один-единственный раз.
    
    !!! note "Технические детали"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 04:21:06 GMT 2024
    - 19.6K bytes
    - Viewed (0)
  5. docs/de/docs/tutorial/dependencies/dependencies-with-yield.md

    # Abhängigkeiten mit yield
    
    FastAPI unterstützt Abhängigkeiten, die nach Abschluss einige <abbr title="Manchmal auch genannt „Exit Code“, „Cleanup Code“, „Teardown Code“, „Closing Code“, „Kontext Manager Exit Code“, usw.">zusätzliche Schritte ausführen</abbr>.
    
    Verwenden Sie dazu `yield` statt `return` und schreiben Sie die zusätzlichen Schritte / den zusätzlichen Code danach.
    
    !!! tip "Tipp"
        Stellen Sie sicher, dass Sie `yield` nur einmal pro Abhängigkeit verwenden.
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 18:10:29 GMT 2024
    - 13.5K bytes
    - Viewed (0)
  6. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 10.3K 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/handling-errors.md

    ```
    
    Here, if you request `/unicorns/yolo`, the *path operation* will `raise` a `UnicornException`.
    
    But it will be handled by the `unicorn_exception_handler`.
    
    So, you will receive a clean error, with an HTTP status code of `418` and a JSON content of:
    
    ```JSON
    {"message": "Oops! yolo did something. There goes a rainbow..."}
    ```
    
    !!! note "Technical Details"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  9. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  10. docs/en/docs/contributing.md

    ### Format the code
    
    There is a script that you can run that will format and clean all your code:
    
    <div class="termy">
    
    ```console
    $ bash scripts/format.sh
    ```
    
    </div>
    
    It will also auto-sort all your imports.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jan 11 17:42:43 GMT 2024
    - 14.1K bytes
    - Viewed (0)
Back to top