Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 539 for yield (0.04 sec)

  1. docs/em/docs/tutorial/dependencies/dependencies-with-yield.md

    ///
    
    ## ๐Ÿ”— โฎ๏ธ `yield` & `HTTPException`
    
    ๐Ÿ‘† ๐Ÿ‘€ ๐Ÿ‘ˆ ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ ๐Ÿ”— โฎ๏ธ `yield` & โœ”๏ธ `try` ๐Ÿซ ๐Ÿ‘ˆ โœŠ โš .
    
    โšซ๏ธ 5๏ธโƒฃ๐Ÿ“† ๐Ÿ˜‹ ๐Ÿคš `HTTPException` โš–๏ธ ๐ŸŽ ๐Ÿšช ๐Ÿ“Ÿ, โฎ๏ธ `yield`. โœ‹๏ธ **โšซ๏ธ ๐Ÿ† ๐Ÿšซ ๐Ÿ‘ท**.
    
    ๐Ÿšช ๐Ÿ“Ÿ ๐Ÿ”— โฎ๏ธ `yield` ๐Ÿ› ๏ธ *โฎ๏ธ* ๐Ÿ“จ ๐Ÿ“จ, [โš  ๐Ÿ•โ€๐Ÿฆบ](../handling-errors.md#_4){.internal-link target=_blank} ๐Ÿ”œ โœ”๏ธ โช ๐Ÿƒ. ๐Ÿ“ค ๐Ÿ•ณ ๐Ÿ˜ฝ โš  ๐Ÿšฎ ๐Ÿ‘† ๐Ÿ”— ๐Ÿšช ๐Ÿ“Ÿ (โฎ๏ธ `yield`).
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 8.6K bytes
    - Viewed (0)
  2. src/bytes/iter.go

    		return explodeSeq(s)
    	}
    	return func(yield func([]byte) bool) {
    		for {
    			i := Index(s, sep)
    			if i < 0 {
    				break
    			}
    			frag := s[:i+sepSave]
    			if !yield(frag[:len(frag):len(frag)]) {
    				return
    			}
    			s = s[i+len(sep):]
    		}
    		yield(s[:len(s):len(s)])
    	}
    }
    
    // SplitSeq returns an iterator over all substrings of s separated by sep.
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Wed Aug 14 18:23:13 UTC 2024
    - 3.7K bytes
    - Viewed (0)
  3. docs/em/docs/advanced/events.md

    `shutdown` ๐Ÿ”œ ๐Ÿ”จ ๐Ÿ•โ” ๐Ÿ‘† **โ›”๏ธ** ๐Ÿˆธ.
    
    ๐ŸŽฒ ๐Ÿ‘† ๐Ÿ’ช โ–ถ๏ธ ๐Ÿ†• โฌ, โš–๏ธ ๐Ÿ‘† ๐Ÿคš ๐ŸŽก ๐Ÿƒ โšซ๏ธ. ๐Ÿคท
    
    ///
    
    ### ๐Ÿ”† ๐Ÿ”ข
    
    ๐Ÿฅ‡ ๐Ÿ‘œ ๐Ÿ‘€, ๐Ÿ‘ˆ ๐Ÿ‘ฅ โš– ๐Ÿ” ๐Ÿ”ข โฎ๏ธ `yield`. ๐Ÿ‘‰ ๐Ÿ“ถ ๐ŸŽ ๐Ÿ”— โฎ๏ธ `yield`.
    
    ```Python hl_lines="14-19"
    {!../../docs_src/events/tutorial003.py!}
    ```
    
    ๐Ÿฅ‡ ๐Ÿ• ๐Ÿ”ข, โญ `yield`, ๐Ÿ”œ ๐Ÿ› ๏ธ **โญ** ๐Ÿˆธ โ–ถ๏ธ.
    
    &amp; ๐Ÿ• โฎ๏ธ `yield` ๐Ÿ”œ ๐Ÿ› ๏ธ **โฎ๏ธ** ๐Ÿˆธ โœ”๏ธ ๐Ÿ.
    
    ### ๐Ÿ” ๐Ÿ”‘ ๐Ÿ‘จโ€๐Ÿ’ผ
    
    ๐Ÿšฅ ๐Ÿ‘† โœ…, ๐Ÿ”ข ๐ŸŽ€ โฎ๏ธ `@asynccontextmanager`.
    
    ๐Ÿ‘ˆ ๐Ÿ—œ ๐Ÿ”ข ๐Ÿ”˜ ๐Ÿ•ณ ๐Ÿค™ "**๐Ÿ” ๐Ÿ”‘ ๐Ÿ‘จโ€๐Ÿ’ผ**".
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  4. docs_src/dependencies/tutorial008_an_py39.py

    from fastapi import Depends
    
    
    async def dependency_a():
        dep_a = generate_dep_a()
        try:
            yield dep_a
        finally:
            dep_a.close()
    
    
    async def dependency_b(dep_a: Annotated[DepA, Depends(dependency_a)]):
        dep_b = generate_dep_b()
        try:
            yield dep_b
        finally:
            dep_b.close(dep_a)
    
    
    async def dependency_c(dep_b: Annotated[DepB, Depends(dependency_b)]):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 521 bytes
    - Viewed (0)
  5. tests/test_dependency_contextvars.py

    
    client = TestClient(app)
    
    
    def test_dependency_contextvars():
        """
        Check that custom middlewares don't affect the contextvar context for dependencies.
    
        The code before yield and the code after yield should be run in the same contextvar
        context, so that request_state_context_var.reset(contextvar_token).
    
        If they are run in a different context, that raises an error.
        """
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Feb 17 12:40:12 UTC 2022
    - 1.5K bytes
    - Viewed (0)
  6. tests/test_router_events.py

        async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
            yield
    
        @asynccontextmanager
        async def router_lifespan(app: FastAPI) -> AsyncGenerator[Dict[str, bool], None]:
            yield {"router": True}
    
        @asynccontextmanager
        async def sub_router_lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
            yield
    
        sub_router = APIRouter(lifespan=sub_router_lifespan)
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 24 19:09:52 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  7. docs_src/dependencies/tutorial008.py

        dep_a = generate_dep_a()
        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:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 455 bytes
    - Viewed (0)
  8. docs_src/dependencies/tutorial009.py

        dep_a = generate_dep_a()
        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:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 455 bytes
    - Viewed (0)
  9. docs_src/dependencies/tutorial008_an.py

    from typing_extensions import Annotated
    
    
    async def dependency_a():
        dep_a = generate_dep_a()
        try:
            yield dep_a
        finally:
            dep_a.close()
    
    
    async def dependency_b(dep_a: Annotated[DepA, Depends(dependency_a)]):
        dep_b = generate_dep_b()
        try:
            yield dep_b
        finally:
            dep_b.close(dep_a)
    
    
    async def dependency_c(dep_b: Annotated[DepB, Depends(dependency_b)]):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 531 bytes
    - Viewed (0)
  10. docs/pt/docs/advanced/events.md

    A primeira coisa a notar, รฉ que estamos definindo uma funรงรฃo assรญncrona com `yield`. Isso รฉ muito semelhante ร  Dependรชncias com `yield`.
    
    ```Python hl_lines="14-19"
    {!../../docs_src/events/tutorial003.py!}
    ```
    
    A primeira parte da funรงรฃo, antes do `yield`, serรก  executada **antes** da aplicaรงรฃo inicializar.
    
    E a parte posterior do `yield` irรก executar **apรณs** a aplicaรงรฃo ser encerrada.
    
    ### Gerenciador de Contexto Assรญncrono
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 8.6K bytes
    - Viewed (0)
Back to top