- Sort Score
- Num 10 results
- Language All
Results 71 - 80 of 236 for yielded (0.04 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
docs/es/docs/tutorial/server-sent-events.md
## Streaming de SSE con FastAPI { #stream-sse-with-fastapi } Para hacer streaming de SSE con FastAPI, usa `yield` en tu path operation function y establece `response_class=EventSourceResponse`. import `EventSourceResponse` de `fastapi.sse`: {* ../../docs_src/server_sent_events/tutorial001_py310.py ln[1:25] hl[4,22] *} Cada ítem producido con `yield` se codifica como JSON y se envía en el campo `data:` de un evento SSE.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:12:26 GMT 2026 - 5K bytes - Click Count (0) -
scripts/tests/test_translation_fixer/conftest.py
with runner.isolated_filesystem(): yield runner @pytest.fixture(name="root_dir") def prepare_paths(runner): docs_dir = Path("docs") en_docs_dir = docs_dir / "en" / "docs" lang_docs_dir = docs_dir / "lang" / "docs" en_docs_dir.mkdir(parents=True, exist_ok=True) lang_docs_dir.mkdir(parents=True, exist_ok=True) yield Path.cwd() @pytest.fixture
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Feb 25 10:37:59 GMT 2026 - 1.3K bytes - Click Count (0) -
tests/test_dependency_yield_scope_websockets.py
class Session: def __init__(self) -> None: self.open = True async def dep_session() -> Any: s = Session() yield s s.open = False global_state = global_context.get() global_state["session_closed"] = True SessionFuncDep = Annotated[Session, Depends(dep_session, scope="function")]Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 6K bytes - Click Count (0) -
tests/test_stream_bare_type.py
class Item(BaseModel): name: str app = FastAPI() @app.get("/items/stream-bare-async") async def stream_bare_async() -> AsyncIterable: yield {"name": "foo"} @app.get("/items/stream-bare-sync") def stream_bare_sync() -> Iterable: yield {"name": "bar"} client = TestClient(app) def test_stream_bare_async_iterable(): response = client.get("/items/stream-bare-async")
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Feb 27 18:56:47 GMT 2026 - 1.1K bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/server-sent-events.md
/// ## 使用 FastAPI 串流 SSE { #stream-sse-with-fastapi } 要在 FastAPI 中串流 SSE,請在你的路徑操作函式(path operation function)中使用 `yield`,並設定 `response_class=EventSourceResponse`。 從 `fastapi.sse` 匯入 `EventSourceResponse`: {* ../../docs_src/server_sent_events/tutorial001_py310.py ln[1:25] hl[4,22] *} 每個 `yield` 的項目都會以 JSON 編碼並放在 SSE 事件的 `data:` 欄位中送出。 如果你把回傳型別宣告為 `AsyncIterable[Item]`,FastAPI 會用它來透過 Pydantic 進行**驗證**、**文件化**與**序列化**。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:33:04 GMT 2026 - 4.6K bytes - Click Count (0) -
docs/zh/docs/tutorial/server-sent-events.md
/// ## 使用 FastAPI 流式传输 SSE { #stream-sse-with-fastapi } 要在 FastAPI 中流式传输 SSE,在你的*路径操作函数*中使用 `yield`,并设置 `response_class=EventSourceResponse`。 从 `fastapi.sse` 导入 `EventSourceResponse`: {* ../../docs_src/server_sent_events/tutorial001_py310.py ln[1:25] hl[4,22] *} 每个被 yield 的项会被编码为 JSON,并放入 SSE 事件的 `data:` 字段发送。 如果你将返回类型声明为 `AsyncIterable[Item]`,FastAPI 将使用它通过 Pydantic对数据进行**校验**、**文档化**和**序列化**。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) -
docs/fr/docs/tutorial/server-sent-events.md
Pour diffuser des SSE avec FastAPI, utilisez `yield` dans votre *fonction de chemin d'accès* et définissez `response_class=EventSourceResponse`. Importez `EventSourceResponse` depuis `fastapi.sse` : {* ../../docs_src/server_sent_events/tutorial001_py310.py ln[1:25] hl[4,22] *} Chaque élément produit avec `yield` est encodé en JSON et envoyé dans le champ `data:` d’un événement SSE.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:33:45 GMT 2026 - 5.3K bytes - Click Count (0) -
doc/go_spec.html
left, right *Tree[K, V] key K value V } func (t *Tree[K, V]) walk(yield func(key K, val V) bool) bool { return t == nil || t.left.walk(yield) && yield(t.key, t.value) && t.right.walk(yield) } func (t *Tree[K, V]) Walk(yield func(key K, val V) bool) { t.walk(yield) } // walk tree t in-order var t Tree[string, int] for k, v := range t.Walk {
Created: Tue Apr 07 11:13:11 GMT 2026 - Last Modified: Wed Apr 01 23:39:18 GMT 2026 - 287.8K bytes - Click Count (1) -
fastapi/sse.py
"""Represents a single Server-Sent Event. When `yield`ed from a *path operation function* that uses `response_class=EventSourceResponse`, each `ServerSentEvent` is encoded into the [SSE wire format](https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream) (`text/event-stream`). If you yield a plain object (dict, Pydantic model, etc.) instead, it isCreated: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 01 09:21:52 GMT 2026 - 6.2K bytes - Click Count (0) -
tests/test_stream_cancellation.py
"""Async generator with no internal await - would hang without checkpoint.""" i = 0 while True: yield f"item {i}\n" i += 1 @app.get("/stream-jsonl") async def stream_jsonl() -> AsyncIterable[int]: """JSONL async generator with no internal await.""" i = 0 while True: yield i i += 1 async def _run_asgi_and_cancel(app: FastAPI, path: str, timeout: float) -> bool:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Feb 27 18:56:47 GMT 2026 - 2.7K bytes - Click Count (0)