Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 73 for exit (1.05 sec)

  1. docs/en/docs/tutorial/middleware.md

    * It can do something to that **response** or run any needed code.
    * Then it returns the **response**.
    
    !!! note "Technical Details"
        If you have dependencies with `yield`, the exit code will run *after* the middleware.
    
        If there were any background tasks (documented later), they will run *after* all the middleware.
    
    ## Create a middleware
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 16:31:18 GMT 2024
    - 2.9K bytes
    - Viewed (0)
  2. docs/de/docs/tutorial/middleware.md

    * Sie kann etwas mit dieser **Response** tun oder beliebigen Code ausführen.
    * Dann gibt sie die **Response** zurück.
    
    !!! note "Technische Details"
        Wenn Sie Abhängigkeiten mit `yield` haben, wird der Exit-Code *nach* der Middleware ausgeführt.
    
        Wenn es Hintergrundaufgaben gab (später dokumentiert), werden sie *nach* allen Middlewares ausgeführt.
    
    ## Erstellung einer Middleware
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Jan 23 11:26:59 GMT 2024
    - 3.4K bytes
    - Viewed (0)
  3. docs/ko/docs/tutorial/middleware.md

    * **요청**을 응용 프로그램의 *경로 작동*으로 전달하여 처리합니다.
    * 애플리케이션의 *경로 작업*에서 생성한 **응답**를 받습니다.
    * **응답** 또는 다른 필요한 코드를 실행시키는 동작을 할 수 있습니다.
    * **응답**를 반환합니다.
    
    !!! note "기술 세부사항"
        만약 `yield`를 사용한 의존성을 가지고 있다면, 미들웨어가 실행되고 난 후에 exit이 실행됩니다.
    
        만약 (나중에 문서에서 다룰) 백그라운드 작업이 있다면, 모든 미들웨어가 실행되고 *난 후에* 실행됩니다.
    
    ## 미들웨어 만들기
    
    미들웨어를 작성하기 위해서 함수 상단에 `@app.middleware("http")` 데코레이터를 사용할 수 있습니다.
    
    미들웨어 함수는 다음 항목들을 받습니다:
    
    * `request`.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Jan 31 14:35:27 GMT 2024
    - 3.4K bytes
    - Viewed (0)
  4. fastapi/concurrency.py

        except Exception as e:
            ok = bool(
                await anyio.to_thread.run_sync(
                    cm.__exit__, type(e), e, None, limiter=exit_limiter
                )
            )
            if not ok:
                raise e
        else:
            await anyio.to_thread.run_sync(
                cm.__exit__, None, None, None, limiter=exit_limiter
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Dec 25 17:57:35 GMT 2023
    - 1.4K bytes
    - Viewed (0)
  5. 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)
  6. 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 May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:10:29 GMT 2024
    - 13.5K bytes
    - Viewed (0)
  7. .github/actions/comment-docs-preview-in-pr/app/main.py

            logging.error(f"Error parsing event file: {e.errors()}")
            sys.exit(0)
        use_pr: Union[PullRequest, None] = None
        for pr in repo.get_pulls():
            if pr.head.sha == event.workflow_run.head_commit.id:
                use_pr = pr
                break
        if not use_pr:
            logging.error(f"No PR found for hash: {event.workflow_run.head_commit.id}")
            sys.exit(0)
        github_headers = {
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Jan 09 15:02:53 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  8. 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)
  9. .github/actions/notify-translations/app/main.py

        logging.info(f"PR #{pr.number} has labels: {label_strs}")
        if not langs or lang_all_label not in label_strs:
            logging.info(f"PR #{pr.number} doesn't seem to be a translation PR, skipping")
            sys.exit(0)
    
        # Generate translation map, lang ID to discussion
        discussions = get_graphql_translation_discussions(settings=settings)
        lang_to_discussion_map: Dict[str, AllDiscussionsDiscussionNode] = {}
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Sep 27 23:01:46 GMT 2023
    - 12.4K bytes
    - Viewed (0)
  10. docs_src/dependencies/tutorial010.py

    class MySuperContextManager:
        def __init__(self):
            self.db = DBSession()
    
        def __enter__(self):
            return self.db
    
        def __exit__(self, exc_type, exc_value, traceback):
            self.db.close()
    
    
    async def get_db():
        with MySuperContextManager() as db:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 292 bytes
    - Viewed (0)
Back to top