Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 261 - 270 of 795 for asyncId (0.06 seconds)

  1. docs_src/app_testing/app_b_py310/main.py

    
    @app.get("/items/{item_id}", response_model=Item)
    async def read_main(item_id: str, x_token: str = Header()):
        if x_token != fake_secret_token:
            raise HTTPException(status_code=400, detail="Invalid X-Token header")
        if item_id not in fake_db:
            raise HTTPException(status_code=404, detail="Item not found")
        return fake_db[item_id]
    
    
    @app.post("/items/")
    async def create_item(item: Item, x_token: str = Header()) -> Item:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Feb 04 13:32:24 GMT 2026
    - 1.1K bytes
    - Click Count (0)
  2. fastapi/.agents/skills/fastapi/references/dependencies.md

    app = FastAPI()
    
    
    def get_db():
        db = DBSession()
        try:
            yield db
        finally:
            db.close()
    
    
    DBDep = Annotated[DBSession, Depends(get_db)]
    
    
    @app.get("/items/")
    async def read_items(db: DBDep):
        return db.query(Item).all()
    ```
    
    Use the scope `"function"` when they should run the exit code after the response data is generated but before the response is sent back to the client.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 01 10:05:57 GMT 2026
    - 3.2K bytes
    - Click Count (0)
  3. tensorflow/c/eager/c_api_internal.h

    // TODO(b/154564140): Move this to its own header. This requires splitting
    // c_api_experimental.h
    struct TFE_ContextOptions {
      TF_SessionOptions session_options;
      // true if async execution is enabled.
      bool async = false;
      TFE_ContextDevicePlacementPolicy device_placement_policy{
          TFE_DEVICE_PLACEMENT_SILENT};
      // If true, use TFRT backend
      bool use_tfrt = false;
    Created: Tue Apr 07 12:39:13 GMT 2026
    - Last Modified: Wed Jan 18 19:26:34 GMT 2023
    - 1.9K bytes
    - Click Count (0)
  4. docs/zh/docs/tutorial/server-sent-events.md

    /// tip | 提示
    
    由于 Pydantic 会在**Rust** 端序列化它,相比未声明返回类型,你将获得更高的**性能**。
    
    ///
    
    ### 非 async 的*路径操作函数* { #non-async-path-operation-functions }
    
    你也可以使用常规的 `def` 函数(没有 `async`),并以同样的方式使用 `yield`。
    
    FastAPI 会确保其正确运行,从而不阻塞事件循环。
    
    由于此时函数不是 async,正确的返回类型应为 `Iterable[Item]`:
    
    {* ../../docs_src/server_sent_events/tutorial001_py310.py ln[28:31] hl[29] *}
    
    ### 无返回类型 { #no-return-type }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:29:48 GMT 2026
    - 4.6K bytes
    - Click Count (0)
  5. docs/fr/docs/tutorial/stream-json-lines.md

    ///
    
    ### Fonctions de chemin d'accès non asynchrones { #non-async-path-operation-functions }
    
    Vous pouvez aussi utiliser des fonctions `def` classiques (sans `async`), et utiliser `yield` de la même manière.
    
    FastAPI s'assure qu'elle s'exécute correctement afin de ne pas bloquer la boucle d'événements.
    
    Comme dans ce cas la fonction n'est pas async, le bon type de retour serait `Iterable[Item]` :
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:33:45 GMT 2026
    - 4.9K bytes
    - Click Count (0)
  6. docs/uk/docs/tutorial/testing.md

    ///
    
    /// tip | Порада
    
    Якщо ви хочете викликати `async`-функції у ваших тестах, окрім відправлення запитів до вашого застосунку FastAPI (наприклад, асинхронні функції роботи з базою даних), перегляньте [Async Tests](../advanced/async-tests.md) у розширеному керівництві.
    
    ///
    
    ## Розділення тестів { #separating-tests }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:27:41 GMT 2026
    - 8.6K bytes
    - Click Count (0)
  7. tests/test_request_params/test_query/test_optional_str.py

    # Without aliases
    
    
    @app.get("/optional-str")
    async def read_optional_str(p: str | None = None):
        return {"p": p}
    
    
    class QueryModelOptionalStr(BaseModel):
        p: str | None = None
    
    
    @app.get("/model-optional-str")
    async def read_model_optional_str(p: Annotated[QueryModelOptionalStr, Query()]):
        return {"p": p.p}
    
    
    @pytest.mark.parametrize(
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 8.4K bytes
    - Click Count (0)
  8. tests/test_additional_responses_union_duplicate_anyof.py

                "model": ModelA | ModelB,
                "content": {"application/json": {"examples": {"Case A": {"value": "a"}}}},
            }
        }
    )
    
    
    @app.get("/route1")
    async def route1():
        pass  # pragma: no cover
    
    
    @app.get("/route2")
    async def route2():
        pass  # pragma: no cover
    
    
    client = TestClient(app)
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 4.3K bytes
    - Click Count (0)
  9. src/main/java/jcifs/internal/witness/WitnessRpcClient.java

                    }
                } else {
                    log.warn("Async notify failed: {}", message.getErrorMessage());
                }
    
                return null;
    
            } catch (Exception e) {
                throw new IOException("Witness async notify RPC failed", e);
            }
        }
    
        /**
         * Generates a registration ID from context handle and share name.
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Sun Aug 24 00:12:28 GMT 2025
    - 12.1K bytes
    - Click Count (0)
  10. tests/test_request_params/test_body/test_optional_list.py

    
    @app.post("/optional-list-str", operation_id="optional_list_str")
    async def read_optional_list_str(
        p: Annotated[list[str] | None, Body(embed=True)] = None,
    ):
        return {"p": p}
    
    
    class BodyModelOptionalListStr(BaseModel):
        p: list[str] | None = None
    
    
    @app.post("/model-optional-list-str", operation_id="model_optional_list_str")
    async def read_model_optional_list_str(p: BodyModelOptionalListStr):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 12.6K bytes
    - Click Count (0)
Back to Top