Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 21 for BackgroundTasks (0.3 sec)

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

        * ๐Ÿ–ผ, โžก๏ธ ๐Ÿ’ฌ ๐Ÿ‘† ๐Ÿ“จ ๐Ÿ“ ๐Ÿ‘ˆ ๐Ÿ”œ ๐Ÿšถ ๐Ÿ”˜ ๐ŸŒ ๐Ÿ› ๏ธ, ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ“จ ๐Ÿ“จ "๐Ÿšซ" (๐Ÿ‡บ๐Ÿ‡ธ๐Ÿ” 2๏ธโƒฃ0๏ธโƒฃ2๏ธโƒฃ) & ๐Ÿ› ๏ธ โšซ๏ธ ๐Ÿ–ฅ.
    
    ## โš™๏ธ `BackgroundTasks`
    
    ๐Ÿฅ‡, ๐Ÿ—„ `BackgroundTasks` & ๐Ÿ”ฌ ๐Ÿ”ข ๐Ÿ‘† *โžก ๐Ÿ› ๏ธ ๐Ÿ”ข* โฎ๏ธ ๐Ÿ†Ž ๐Ÿ“„ `BackgroundTasks`:
    
    ```Python hl_lines="1  13"
    {!../../docs_src/background_tasks/tutorial001.py!}
    ```
    
    **FastAPI** ๐Ÿ”œ โœ ๐ŸŽš ๐Ÿ†Ž `BackgroundTasks` ๐Ÿ‘† & ๐Ÿšถโ€โ™€๏ธ โšซ๏ธ ๐Ÿ‘ˆ ๐Ÿ”ข.
    
    ## โœ ๐Ÿ“‹ ๐Ÿ”ข
    
    โœ ๐Ÿ”ข ๐Ÿƒ ๐Ÿ–ฅ ๐Ÿ“‹.
    
    โšซ๏ธ ๐Ÿฉ ๐Ÿ”ข ๐Ÿ‘ˆ ๐Ÿ’ช ๐Ÿ“จ ๐Ÿ”ข.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  2. docs/zh/docs/tutorial/background-tasks.md

    * ๅค„็†ๆ•ฐๆฎ๏ผš
        * ไพ‹ๅฆ‚๏ผŒๅ‡่ฎพๆ‚จๆ”ถๅˆฐ็š„ๆ–‡ไปถๅฟ…้กป็ป่ฟ‡ไธ€ไธช็ผ“ๆ…ข็š„่ฟ‡็จ‹๏ผŒๆ‚จๅฏไปฅ่ฟ”ๅ›žไธ€ไธช"Accepted"(HTTP 202)ๅ“ๅบ”ๅนถๅœจๅŽๅฐๅค„็†ๅฎƒใ€‚
    
    ## ไฝฟ็”จ `BackgroundTasks`
    
    ้ฆ–ๅ…ˆๅฏผๅ…ฅ `BackgroundTasks` ๅนถๅœจ *่ทฏๅพ„ๆ“ไฝœๅ‡ฝๆ•ฐ* ไธญไฝฟ็”จ็ฑปๅž‹ๅฃฐๆ˜Ž `BackgroundTasks` ๅฎšไน‰ไธ€ไธชๅ‚ๆ•ฐ๏ผš
    
    ```Python hl_lines="1  13"
    {!../../docs_src/background_tasks/tutorial001.py!}
    ```
    
    **FastAPI** ไผšๅˆ›ๅปบไธ€ไธช `BackgroundTasks` ็ฑปๅž‹็š„ๅฏน่ฑกๅนถไฝœไธบ่ฏฅๅ‚ๆ•ฐไผ ๅ…ฅใ€‚
    
    ## ๅˆ›ๅปบไธ€ไธชไปปๅŠกๅ‡ฝๆ•ฐ
    
    ๅˆ›ๅปบ่ฆไฝœไธบๅŽๅฐไปปๅŠก่ฟ่กŒ็š„ๅ‡ฝๆ•ฐใ€‚
    
    ๅฎƒๅชๆ˜ฏไธ€ไธชๅฏไปฅๆŽฅๆ”ถๅ‚ๆ•ฐ็š„ๆ ‡ๅ‡†ๅ‡ฝๆ•ฐใ€‚
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 5K bytes
    - Viewed (0)
  3. docs_src/background_tasks/tutorial001.py

    from fastapi import BackgroundTasks, FastAPI
    
    app = FastAPI()
    
    
    def write_notification(email: str, message=""):
        with open("log.txt", mode="w") as email_file:
            content = f"notification for {email}: {message}"
            email_file.write(content)
    
    
    @app.post("/send-notification/{email}")
    async def send_notification(email: str, background_tasks: BackgroundTasks):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 519 bytes
    - Viewed (0)
  4. docs/ko/docs/tutorial/background-tasks.md

        * ์˜ˆ๋ฅผ ๋“ค์–ด ์ฒ˜๋ฆฌ์— ์˜ค๋žœ ์‹œ๊ฐ„์ด ๊ฑธ๋ฆฌ๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ๋ฐ›์•˜์„ ๋•Œ "Accepted" (HTTP 202)์„ ๋ฐ˜ํ™˜ํ•˜๊ณ , ๋ฐฑ๊ทธ๋ผ์šด๋“œ์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
    
    ## `๋ฐฑ๊ทธ๋ผ์šด๋“œ ์ž‘์—…` ์‚ฌ์šฉ
    
    ๋จผ์ € ์•„๋ž˜์™€ ๊ฐ™์ด `BackgroundTasks`๋ฅผ ์ž„ํฌํŠธํ•˜๊ณ , `BackgroundTasks`๋ฅผ _๊ฒฝ๋กœ ์ž‘๋™ ํ•จ์ˆ˜_ ์—์„œ ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ๊ฐ€์ ธ์˜ค๊ณ  ์ •์˜ํ•ฉ๋‹ˆ๋‹ค.
    
    ```Python hl_lines="1  13"
    {!../../docs_src/background_tasks/tutorial001.py!}
    ```
    
    **FastAPI** ๋Š” `BackgroundTasks` ๊ฐœ์ฒด๋ฅผ ์ƒ์„ฑํ•˜๊ณ , ๋งค๊ฐœ ๋ณ€์ˆ˜๋กœ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค.
    
    ## ์ž‘์—… ํ•จ์ˆ˜ ์ƒ์„ฑ
    
    ๋ฐฑ๊ทธ๋ผ์šด๋“œ ์ž‘์—…์œผ๋กœ ์‹คํ–‰ํ•  ํ•จ์ˆ˜๋ฅผ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค.
    
    ์ด๊ฒƒ์€ ๋‹จ์ˆœํžˆ ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ ๋ฐ›์„ ์ˆ˜ ์žˆ๋Š” ํ‘œ์ค€ ํ•จ์ˆ˜์ผ ๋ฟ์ž…๋‹ˆ๋‹ค.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  5. docs/ja/docs/tutorial/background-tasks.md

    * ใƒ‡ใƒผใ‚ฟๅ‡ฆ็†:
        * ใŸใจใˆใฐใ€ๆ™‚้–“ใฎใ‹ใ‹ใ‚‹ๅ‡ฆ็†ใ‚’ๅฟ…่ฆใจใ™ใ‚‹ใƒ•ใ‚กใ‚คใƒซๅ—ไฟกๆ™‚ใซใฏใ€ใ€Œๅ—ไฟกๆธˆใฟใ€(HTTP 202) ใฎใƒฌใ‚นใƒใƒณใ‚นใ‚’่ฟ”ใ—ใ€ใƒใƒƒใ‚ฏใ‚ฐใƒฉใ‚ฆใƒณใƒ‰ใงๅ‡ฆ็†ใงใใพใ™ใ€‚
    
    ## `BackgroundTasks` ใฎไฝฟ็”จ
    
    ใพใšๅˆใ‚ใซใ€`BackgroundTasks` ใ‚’ใ‚คใƒณใƒใƒผใƒˆใ—ใ€` BackgroundTasks` ใฎๅž‹ๅฎฃ่จ€ใจๅ…ฑใซใ€*path operation ้–ขๆ•ฐ* ใฎใƒ‘ใƒฉใƒกใƒผใ‚ฟใƒผใ‚’ๅฎš็พฉใ—ใพใ™:
    
    ```Python hl_lines="1  13"
    {!../../docs_src/background_tasks/tutorial001.py!}
    ```
    
    **FastAPI** ใฏใ€`BackgroundTasks` ๅž‹ใฎใ‚ชใƒ–ใ‚ธใ‚งใ‚ฏใƒˆใ‚’ไฝœๆˆใ—ใ€ใใฎใƒ‘ใƒฉใƒกใƒผใ‚ฟใƒผใซๆธกใ—ใพใ™ใ€‚
    
    ## ใ‚ฟใ‚นใ‚ฏ้–ขๆ•ฐใฎไฝœๆˆ
    
    ใƒใƒƒใ‚ฏใ‚ฐใƒฉใ‚ฆใƒณใƒ‰ใ‚ฟใ‚นใ‚ฏใจใ—ใฆๅฎŸ่กŒใ•ใ‚Œใ‚‹้–ขๆ•ฐใ‚’ไฝœๆˆใ—ใพใ™ใ€‚
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 6K bytes
    - Viewed (0)
  6. docs_src/background_tasks/tutorial002_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import BackgroundTasks, Depends, FastAPI
    
    app = FastAPI()
    
    
    def write_log(message: str):
        with open("log.txt", mode="a") as log:
            log.write(message)
    
    
    def get_query(background_tasks: BackgroundTasks, q: Union[str, None] = None):
        if q:
            message = f"found query: {q}\n"
            background_tasks.add_task(write_log, message)
        return q
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 696 bytes
    - Viewed (0)
  7. docs_src/background_tasks/tutorial002_an.py

    from typing import Union
    
    from fastapi import BackgroundTasks, Depends, FastAPI
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    def write_log(message: str):
        with open("log.txt", mode="a") as log:
            log.write(message)
    
    
    def get_query(background_tasks: BackgroundTasks, q: Union[str, None] = None):
        if q:
            message = f"found query: {q}\n"
            background_tasks.add_task(write_log, message)
        return q
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 725 bytes
    - Viewed (0)
  8. fastapi/__init__.py

    __version__ = "0.115.4"
    
    from starlette import status as status
    
    from .applications import FastAPI as FastAPI
    from .background import BackgroundTasks as BackgroundTasks
    from .datastructures import UploadFile as UploadFile
    from .exceptions import HTTPException as HTTPException
    from .exceptions import WebSocketException as WebSocketException
    from .param_functions import Body as Body
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 21:51:55 UTC 2024
    - 1.1K bytes
    - Viewed (0)
  9. tests/test_dependency_contextmanager.py

    import json
    from typing import Dict
    
    import pytest
    from fastapi import BackgroundTasks, Depends, FastAPI
    from fastapi.responses import StreamingResponse
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    state = {
        "/async": "asyncgen not started",
        "/sync": "generator not started",
        "/async_raise": "asyncgen raise not started",
        "/sync_raise": "generator raise not started",
        "context_a": "not started a",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 17 04:13:50 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  10. fastapi/dependencies/utils.py

        is_uploadfile_sequence_annotation,
        lenient_issubclass,
        sequence_types,
        serialize_sequence_value,
        value_is_sequence,
    )
    from fastapi.background import BackgroundTasks
    from fastapi.concurrency import (
        asynccontextmanager,
        contextmanager_in_threadpool,
    )
    from fastapi.dependencies.models import Dependant, SecurityRequirement
    from fastapi.logger import logger
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 21:46:26 UTC 2024
    - 34.7K bytes
    - Viewed (0)
Back to top