Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 44 for Mask (0.39 sec)

  1. docs/zh/docs/tutorial/background-tasks.md

    ```Python hl_lines="6-9"
    {!../../../docs_src/background_tasks/tutorial001.py!}
    ```
    
    ## 添加后台任务
    
    在你的 *路径操作函数* 里,用 `.add_task()` 方法将任务函数传到 *后台任务* 对象中:
    
    ```Python hl_lines="14"
    {!../../../docs_src/background_tasks/tutorial001.py!}
    ```
    
    `.add_task()` 接收以下参数:
    
    * 在后台运行的任务函数(`write_notification`)。
    * 应按顺序传递给任务函数的任意参数序列(`email`)。
    * 应传递给任务函数的任意关键字参数(`message="some notification"`)。
    
    ## 依赖注入
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 5K bytes
    - Viewed (0)
  2. tests/test_dependency_contextmanager.py

    async def get_context_b_bg(tasks: BackgroundTasks, state: dict = Depends(context_b)):
        async def bg(state: dict):
            state["bg"] = f"bg set - b: {state['context_b']} - a: {state['context_a']}"
    
        tasks.add_task(bg, state)
        return state
    
    
    # Sync versions
    
    
    @app.get("/sync_async")
    def get_sync_async(state: str = Depends(asyncgen_state)):
        return state
    
    
    @app.get("/sync_sync")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  3. docs/ru/docs/deployment/manually.md

    Starlette и **FastAPI** основаны на <a href="https://anyio.readthedocs.io/en/stable/" class="external-link" target="_blank">AnyIO</a>, которая делает их совместимыми как с <a href="https://docs.python.org/3/library/asyncio-task.html" class="external-link" target="_blank">asyncio</a> - стандартной библиотекой Python, так и с <a href="https://trio.readthedocs.io/en/stable/" class="external-link" target="_blank">Trio</a>.
    
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Apr 03 16:22:47 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  4. docs/zh/docs/deployment/manually.md

    ## Hypercorn with Trio
    
    Starlette 和 **FastAPI** 基于 <a href="https://anyio.readthedocs.io/en/stable/" class="external-link" target="_blank">AnyIO</a>, 所以它们才能同时与 Python 的标准库 <a href="https://docs.python.org/3/library/asyncio-task.html" class="external-link" target="_blank">asyncio</a> 和<a href="https://trio.readthedocs.io/en/stable/" class="external-link" target="_blank">Trio</a> 兼容。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Jan 09 15:39:41 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  5. .github/DISCUSSION_TEMPLATE/questions.yml

              * Read open questions until I find 2 where I can help someone and add a comment to help there.
              * I already hit the "watch" button in this repository to receive notifications and I commit to help at least 2 people that ask questions in the future.
              * Review one Pull Request by downloading the code and following [all the review process](https://fastapi.tiangolo.com/help-fastapi/#review-pull-requests).
    
          options:
    Others
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Aug 03 15:59:41 GMT 2023
    - 5.8K bytes
    - Viewed (1)
  6. docs/en/docs/advanced/security/http-basic-auth.md

        ```Python hl_lines="2  6  10"
        {!> ../../../docs_src/security/tutorial006.py!}
        ```
    
    When you try to open the URL for the first time (or click the "Execute" button in the docs) the browser will ask you for your username and password:
    
    <img src="/img/tutorial/security/image12.png">
    
    ## Check the username
    
    Here's a more complete example.
    
    Use a dependency to check if the username and password are correct.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 14:33:05 GMT 2024
    - 5.9K bytes
    - Viewed (0)
  7. docs/ko/docs/async.md

    ### 당신만의 비동기 코드 작성하기
    
    Starlette(그리고 FastAPI)는 <a href="https://anyio.readthedocs.io/en/stable/" class="external-link" target="_blank">AnyIO</a>를 기반으로 하고있고, 따라서 파이썬 표준 라이브러리인 <a href="https://docs.python.org/3/library/asyncio-task.html" class="external-link" target="_blank">asyncio</a> 및 <a href="https://trio.readthedocs.io/en/stable/" class="external-link" target="_blank">Trio</a>와 호환됩니다.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 26.7K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/dependencies/dependencies-with-yield.md

    ## Context Managers
    
    ### What are "Context Managers"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  9. docs/ko/docs/tutorial/background-tasks.md

    ```Python hl_lines="6-9"
    {!../../../docs_src/background_tasks/tutorial001.py!}
    ```
    
    ## 백그라운드 작업 추가
    
    _경로 작동 함수_ 내에서 작업 함수를 `.add_task()` 함수 통해 _백그라운드 작업_ 개체에 전달합니다.
    
    ```Python hl_lines="14"
    {!../../../docs_src/background_tasks/tutorial001.py!}
    ```
    
    `.add_task()` 함수는 다음과 같은 인자를 받습니다 :
    
    - 백그라운드에서 실행되는 작업 함수 (`write_notification`).
    - 작업 함수에 순서대로 전달되어야 하는 일련의 인자 (`email`).
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Feb 11 13:48:31 GMT 2024
    - 5.7K bytes
    - Viewed (0)
  10. docs/en/docs/tutorial/background-tasks.md

    {!../../../docs_src/background_tasks/tutorial001.py!}
    ```
    
    ## Add the background task
    
    Inside of your *path operation function*, pass your task function to the *background tasks* object with the method `.add_task()`:
    
    ```Python hl_lines="14"
    {!../../../docs_src/background_tasks/tutorial001.py!}
    ```
    
    `.add_task()` receives as arguments:
    
    * A task function to be run in the background (`write_notification`).
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 5.6K bytes
    - Viewed (0)
Back to top