Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 56 for closure (0.16 sec)

  1. tests/test_ws_router.py

                await websocket.close(code=status.WS_1006_ABNORMAL_CLOSURE, reason=repr(e))
    
        myapp = make_app(middleware=[Middleware(errorhandler)])
        client = TestClient(myapp)
        with pytest.raises(WebSocketDisconnect) as e:
            with client.websocket_connect("/depends-err/"):
                pass  # pragma: no cover
        assert e.value.code == status.WS_1006_ABNORMAL_CLOSURE
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 11 19:08:14 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  2. tests/test_ws_dependencies.py

        await websocket.accept()
        await websocket.send_text(json.dumps(deps))
        await websocket.close()
    
    
    @router.websocket("/router", dependencies=[create_dependency("routerindex")])
    async def routerindex(websocket: WebSocket, deps: DepList):
        await websocket.accept()
        await websocket.send_text(json.dumps(deps))
        await websocket.close()
    
    
    @prefix_router.websocket("/", dependencies=[create_dependency("routerprefixindex")])
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 11 20:35:39 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  3. scripts/playwright/separate_openapi_schemas/image03.py

        page.screenshot(
            path="docs/en/docs/img/tutorial/separate-openapi-schemas/image03.png"
        )
    
        # ---------------------
        context.close()
        browser.close()
    
    
    process = subprocess.Popen(
        ["uvicorn", "docs_src.separate_openapi_schemas.tutorial001:app"]
    )
    try:
        with sync_playwright() as playwright:
            run(playwright)
    finally:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Aug 25 19:10:22 GMT 2023
    - 892 bytes
    - Viewed (0)
  4. docs/em/docs/tutorial/request-files.md

    * `read(size)`: โœ `size` (`int`) ๐Ÿ”ข/๐Ÿฆน ๐Ÿ“.
    * `seek(offset)`: ๐Ÿšถ ๐Ÿ”ข ๐Ÿง˜ `offset` (`int`) ๐Ÿ“.
        * ๐Ÿคถ โ“‚., `await myfile.seek(0)` ๐Ÿ”œ ๐Ÿšถ โ–ถ๏ธ ๐Ÿ“.
        * ๐Ÿ‘‰ โœด๏ธ โš  ๐Ÿšฅ ๐Ÿ‘† ๐Ÿƒ `await myfile.read()` ๐Ÿ• & โคด๏ธ ๐Ÿ’ช โœ ๐ŸŽš ๐Ÿ”„.
    * `close()`: ๐Ÿ” ๐Ÿ“.
    
    ๐ŸŒ ๐Ÿ‘ซ ๐Ÿ‘ฉโ€๐Ÿ”ฌ `async` ๐Ÿ‘ฉโ€๐Ÿ”ฌ, ๐Ÿ‘† ๐Ÿ’ช "โŒ›" ๐Ÿ‘ซ.
    
    ๐Ÿ–ผ, ๐Ÿ”˜ `async` *โžก ๐Ÿ› ๏ธ ๐Ÿ”ข* ๐Ÿ‘† ๐Ÿ’ช ๐Ÿคš ๐ŸŽš โฎ๏ธ:
    
    ```Python
    contents = await myfile.read()
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 6.6K bytes
    - Viewed (0)
  5. docs/ko/docs/tutorial/request-files.md

    * `read(size)`: ํŒŒ์ผ์˜ ๋ฐ”์ดํŠธ ๋ฐ ๊ธ€์ž์˜ `size`(`int`)๋ฅผ ์ฝ์Šต๋‹ˆ๋‹ค.
    * `seek(offset)`: ํŒŒ์ผ ๋‚ด `offset`(`int`) ์œ„์น˜์˜ ๋ฐ”์ดํŠธ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.
        * ์˜ˆ) `await myfile.seek(0)` ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ํŒŒ์ผ์˜ ์‹œ์ž‘๋ถ€๋ถ„์œผ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.
        * `await myfile.read()` ๋ฅผ ์‚ฌ์šฉํ•œ ํ›„ ๋‚ด์šฉ์„ ๋‹ค์‹œ ์ฝ์„ ๋•Œ ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค.
    * `close()`: ํŒŒ์ผ์„ ๋‹ซ์Šต๋‹ˆ๋‹ค.
    
    ์ƒ๊ธฐ ๋ชจ๋“  ๋ฉ”์†Œ๋“œ๋“ค์ด `async` ๋ฉ”์†Œ๋“œ์ด๊ธฐ ๋•Œ๋ฌธ์— โ€œawaitโ€์„ ์‚ฌ์šฉํ•˜์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค.
    
    ์˜ˆ๋ฅผ๋“ค์–ด, `async` *๊ฒฝ๋กœ ์ž‘๋™ ํ•จ์ˆ˜*์˜ ๋‚ด๋ถ€์—์„œ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋ฐฉ์‹์œผ๋กœ ๋‚ด์šฉ์„ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:
    
    ```Python
    contents = await myfile.read()
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 8.1K bytes
    - Viewed (0)
  6. docs/en/docs/alternatives.md

    Routes are declared in a single place, using functions declared in other places (instead of using decorators that can be placed right on top of the function that handles the endpoint). This is closer to how Django does it than to how Flask (and Starlette) does it. It separates in the code things that are relatively tightly coupled.
    
    !!! check "Inspired **FastAPI** to"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 23.2K bytes
    - Viewed (0)
  7. docs_src/dependencies/tutorial009.py

        try:
            yield dep_a
        finally:
            dep_a.close()
    
    
    async def dependency_b(dep_a=Depends(dependency_a)):
        dep_b = generate_dep_b()
        try:
            yield dep_b
        finally:
            dep_b.close(dep_a)
    
    
    async def dependency_c(dep_b=Depends(dependency_b)):
        dep_c = generate_dep_c()
        try:
            yield dep_c
        finally:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 455 bytes
    - Viewed (0)
  8. scripts/playwright/separate_openapi_schemas/image02.py

        page.get_by_role("button", name="Execute").click()
        page.screenshot(
            path="docs/en/docs/img/tutorial/separate-openapi-schemas/image02.png"
        )
    
        # ---------------------
        context.close()
        browser.close()
    
    
    process = subprocess.Popen(
        ["uvicorn", "docs_src.separate_openapi_schemas.tutorial001:app"]
    )
    try:
        with sync_playwright() as playwright:
            run(playwright)
    finally:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Aug 25 19:10:22 GMT 2023
    - 873 bytes
    - Viewed (0)
  9. docs/en/docs/reference/uploadfile.md

            members:
                - file
                - filename
                - size
                - headers
                - content_type
                - read
                - write
                - seek
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 472 bytes
    - Viewed (0)
  10. tests/test_tutorial/test_websockets/test_tutorial003.py

            client1_says = "Client #1234 says: Hello from 1234"
            assert data2 == client1_says
            data1 = connection.receive_text()
            assert data1 == client1_says
            connection_two.close()
            data1 = connection.receive_text()
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jul 29 09:26:07 GMT 2021
    - 872 bytes
    - Viewed (0)
Back to top