- Sort Score
- Num 10 results
- Language All
Results 51 - 60 of 748 for asyncId (0.36 seconds)
-
guava-tests/test/com/google/common/util/concurrent/SettableFutureTest.java
public void testCancel_beforeSet() throws Exception { SettableFuture<Object> async = SettableFuture.create(); async.cancel(true); assertFalse(async.set(42)); } public void testCancel_multipleBeforeSetFuture_noInterruptFirst() throws Exception { SettableFuture<Object> async = SettableFuture.create(); async.cancel(false); async.cancel(true); SettableFuture<Object> inner = SettableFuture.create();
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Mar 16 22:45:21 GMT 2026 - 7.4K bytes - Click Count (0) -
tests/test_dependency_partial.py
return value @app.get("/partial-async-callable-dependency") async def get_partial_async_callable_dependency( value: Annotated[ str, Depends( partial(async_callable_dependency, "partial-async-callable-dependency") ), ], ) -> str: return value @app.get("/partial-async-callable-gen-dependency") async def get_partial_async_callable_gen_dependency(
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 6.3K bytes - Click Count (0) -
tests/test_dependency_contextmanager.py
pass class SyncDependencyError(Exception): pass class OtherDependencyError(Exception): pass async def asyncgen_state(state: dict[str, str] = Depends(get_state)): state["/async"] = "asyncgen started" yield state["/async"] state["/async"] = "asyncgen completed" def generator_state(state: dict[str, str] = Depends(get_state)): state["/sync"] = "generator started"
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 11.5K bytes - Click Count (0) -
tests/test_stream_cancellation.py
@app.get("/stream-raw", response_class=StreamingResponse) async def stream_raw() -> AsyncIterable[str]: """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
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) -
tests/test_multipart_installation.py
monkeypatch.delattr("multipart.multipart.parse_options_header", raising=False) with pytest.raises(RuntimeError, match=multipart_incorrect_install_error): app = FastAPI() @app.post("/") async def root(username: str = Form()): return username # pragma: nocover def test_incorrect_multipart_installed_file_upload(monkeypatch): monkeypatch.setattr("python_multipart.__version__", "0.0.12")
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Oct 27 21:46:26 GMT 2024 - 5.7K bytes - Click Count (0) -
tests/test_ambiguous_params.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Dec 20 15:55:38 GMT 2025 - 2K bytes - Click Count (1) -
docs_src/stream_data/tutorial002_py310.py
media_type = "image/png" @app.get("/image/stream", response_class=PNGStreamingResponse) async def stream_image() -> AsyncIterable[bytes]: with read_image() as image_file: for chunk in image_file: yield chunk @app.get("/image/stream-no-async", response_class=PNGStreamingResponse) def stream_image_no_async() -> Iterable[bytes]: with read_image() as image_file:
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Feb 27 20:51:40 GMT 2026 - 5.6K bytes - Click Count (0) -
tests/test_router_events.py
def test_merged_mixed_state_lifespans() -> None: @asynccontextmanager 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
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 11.7K bytes - Click Count (0) -
tests/test_dependency_cache.py
counter_holder = {"counter": 0} async def dep_counter(): counter_holder["counter"] += 1 return counter_holder["counter"] async def super_dep(count: int = Depends(dep_counter)): return count @app.get("/counter/") async def get_counter(count: int = Depends(dep_counter)): return {"counter": count} @app.get("/sub-counter/") async def get_sub_counter(Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Aug 23 13:30:24 GMT 2022 - 2.7K bytes - Click Count (0) -
docs/en/docs/advanced/events.md
The first thing to notice, is that we are defining an async function with `yield`. This is very similar to Dependencies with `yield`. {* ../../docs_src/events/tutorial003_py310.py hl[14:19] *} The first part of the function, before the `yield`, will be executed **before** the application starts. And the part after the `yield` will be executed **after** the application has finished. ### Async Context Manager { #async-context-manager }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 7.8K bytes - Click Count (0)