Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for _exit (0.17 sec)

  1. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Dec 25 17:57:35 GMT 2023
    - 1.4K bytes
    - Viewed (0)
  2. fastapi/dependencies/utils.py

                background_tasks=background_tasks,
                response=response,
                dependency_overrides_provider=dependency_overrides_provider,
                dependency_cache=dependency_cache,
                async_exit_stack=async_exit_stack,
            )
            (
                sub_values,
                sub_errors,
                background_tasks,
                _,  # the subdependency returns the same response we have
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:52:56 GMT 2024
    - 29.5K bytes
    - Viewed (0)
  3. docs/em/docs/tutorial/dependencies/dependencies-with-yield.md

        🚥 👆 ▶️ ⏮️ **FastAPI** 👆 💪 💚 🚶 ⚫️ 🔜.
    
    🐍, 👆 💪 ✍ 🔑 👨‍💼 <a href="https://docs.python.org/3/reference/datamodel.html#context-managers" class="external-link" target="_blank">🏗 🎓 ⏮️ 2️⃣ 👩‍🔬: `__enter__()` &amp; `__exit__()`</a>.
    
    👆 💪 ⚙️ 👫 🔘 **FastAPI** 🔗 ⏮️ `yield` ⚙️
    `with` ⚖️ `async with` 📄 🔘 🔗 🔢:
    
    ```Python hl_lines="1-9  13"
    {!../../../docs_src/dependencies/tutorial010.py!}
    ```
    
    !!! tip
    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)
  4. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 292 bytes
    - Viewed (0)
  5. docs/en/docs/tutorial/dependencies/dependencies-with-yield.md

    In Python, you can create Context Managers by <a href="https://docs.python.org/3/reference/datamodel.html#context-managers" class="external-link" target="_blank">creating a class with two methods: `__enter__()` and `__exit__()`</a>.
    
    You can also use them inside of **FastAPI** dependencies with `yield` by using
    `with` or `async with` statements inside of the dependency function:
    
    ```Python hl_lines="1-9  13"
    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)
  6. docs/ko/docs/tutorial/middleware.md

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

    В Python для создания менеджеров контекста можно <a href="https://docs.python.org/3/reference/datamodel.html#context-managers" class="external-link" target="_blank">создать класс с двумя методами: `__enter__()` и `__exit__()`</a>.
    
    Вы также можете использовать их внутри зависимостей **FastAPI** с `yield`, используя операторы
    `with` или `async with` внутри функции зависимости:
    
    ```Python hl_lines="1-9  13"
    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)
  8. docs/de/docs/tutorial/dependencies/dependencies-with-yield.md

    In Python können Sie Kontextmanager erstellen, indem Sie <a href="https://docs.python.org/3/reference/datamodel.html#context-managers" class="external-link" target="_blank">eine Klasse mit zwei Methoden erzeugen: `__enter__()` und `__exit__()`</a>.
    
    Sie können solche auch innerhalb von **FastAPI**-Abhängigkeiten mit `yield` verwenden, indem Sie `with`- oder `async with`-Anweisungen innerhalb der Abhängigkeits-Funktion verwenden:
    
    ```Python hl_lines="1-9  13"
    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)
  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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Sep 27 23:01:46 GMT 2023
    - 12.4K bytes
    - Viewed (0)
  10. .github/actions/people/app/main.py

        if (
            people_old_content == new_people_content
            and github_sponsors_old_content == new_github_sponsors_content
        ):
            logging.info("The FastAPI People data hasn't changed, finishing.")
            sys.exit(0)
        people_path.write_text(new_people_content, encoding="utf-8")
        github_sponsors_path.write_text(new_github_sponsors_content, encoding="utf-8")
        logging.info("Setting up GitHub Actions git user")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 17:38:21 GMT 2024
    - 19.2K bytes
    - Viewed (1)
Back to top