- Sort Score
- Num 10 results
- Language All
Results 51 - 60 of 159 for Callables (0.05 seconds)
-
fastapi/encoders.py
set: list, UUID: str, Url: str, AnyUrl: str, } def generate_encoders_by_class_tuples( type_encoder_map: dict[Any, Callable[[Any], Any]], ) -> dict[Callable[[Any], Any], tuple[Any, ...]]: encoders_by_class_tuples: dict[Callable[[Any], Any], tuple[Any, ...]] = defaultdict( tuple ) for type_, encoder in type_encoder_map.items():Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 15 11:44:39 GMT 2026 - 10.9K bytes - Click Count (0) -
docs/ko/docs/tutorial/dependencies/classes-as-dependencies.md
``` 이 경우 `fluffy`는 클래스 `Cat`의 인스턴스입니다. 그리고 `fluffy`를 만들기 위해 `Cat`을 "호출"하고 있습니다. 따라서 파이썬 클래스도 **호출 가능(callable)**합니다. 그러면 **FastAPI**에서는 파이썬 클래스를 의존성으로 사용할 수 있습니다. FastAPI가 실제로 확인하는 것은 그것이 "호출 가능(callable)"(함수, 클래스, 또는 다른 무엇이든)한지와 정의된 매개변수들입니다. **FastAPI**에서 "호출 가능(callable)"한 것을 의존성으로 넘기면, 그 "호출 가능(callable)"한 것의 매개변수들을 분석하고 *경로 처리 함수*의 매개변수와 동일한 방식으로 처리합니다. 하위 의존성도 포함해서요.
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Feb 14 08:57:01 GMT 2026 - 8K bytes - Click Count (0) -
fastapi/routing.py
# dependencies' AsyncExitStack def request_response( func: Callable[[Request], Awaitable[Response] | Response], ) -> ASGIApp: """ Takes a function or coroutine `func(request) -> response`, and returns an ASGI application. """ f: Callable[[Request], Awaitable[Response]] = ( func # type: ignore[assignment] # ty: ignore[unused-ignore-comment]
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 15 11:44:39 GMT 2026 - 193K bytes - Click Count (0) -
docs/tr/docs/tutorial/dependencies/classes-as-dependencies.md
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Feb 13 12:41:38 GMT 2026 - 7.3K bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/dependencies/classes-as-dependencies.md
``` 在這個例子中,`fluffy` 是 `Cat` 類別的一個實例。 而要建立 `fluffy`,你其實是在「呼叫」`Cat`。 所以,Python 類別本身也是一種 **callable**。 因此,在 **FastAPI** 中,你可以將 Python 類別作為相依性。 FastAPI 其實檢查的是它是否為「callable」(函式、類別或其他),以及它所定義的參數。 如果你在 **FastAPI** 中傳入一個「callable」作為相依性,FastAPI 會分析該「callable」的參數,並以與路徑操作函式參數相同的方式來處理它們,包括子相依性。 這也適用於完全沒有參數的 callable,就和沒有參數的路徑操作函式一樣。 接著,我們可以把上面的相依項(dependable)`common_parameters` 改成類別 `CommonQueryParams`:
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Feb 14 08:15:26 GMT 2026 - 6.7K bytes - Click Count (0) -
guava/src/com/google/common/cache/Cache.java
import java.util.Map; import java.util.concurrent.Callable; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ExecutionException; import org.jspecify.annotations.Nullable; /** * A semi-persistent mapping from keys to values. Cache entries are manually added using {@link * #get(Object, Callable)} or {@link #put(Object, Object)}, and are stored in the cache until eitherCreated: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Tue Mar 03 12:40:22 GMT 2026 - 8K bytes - Click Count (0) -
android/guava-testlib/test/com/google/common/testing/FakeTickerTest.java
}); assertEquals(incrementByNanos * numberOfThreads, ticker.read()); } /** Runs {@code callable} concurrently {@code numberOfThreads} times. */ @GwtIncompatible // concurrency private void runConcurrentTest(int numberOfThreads, Callable<@Nullable Void> callable) throws Exception { ExecutorService executorService = newFixedThreadPool(numberOfThreads); try {Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Tue Mar 17 16:11:48 GMT 2026 - 6.3K bytes - Click Count (0) -
android/guava-testlib/test/com/google/common/util/concurrent/testing/TestingExecutorsTest.java
taskDone = false; Callable<Integer> task = () -> { taskDone = true; return 6; }; Future<Integer> future = TestingExecutors.sameThreadScheduledExecutor().schedule(task, 10000, MILLISECONDS); assertTrue("Should run callable immediately", taskDone); assertEquals(6, (int) future.get()); }Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Mar 16 22:45:21 GMT 2026 - 3.3K bytes - Click Count (0) -
guava-testlib/test/com/google/common/util/concurrent/testing/TestingExecutorsTest.java
taskDone = false; Callable<Integer> task = () -> { taskDone = true; return 6; }; Future<Integer> future = TestingExecutors.sameThreadScheduledExecutor().schedule(task, 10000, MILLISECONDS); assertTrue("Should run callable immediately", taskDone); assertEquals(6, (int) future.get()); }Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Mar 16 22:45:21 GMT 2026 - 3.3K bytes - Click Count (0) -
guava-testlib/test/com/google/common/testing/FakeTickerTest.java
}); assertEquals(incrementByNanos * numberOfThreads, ticker.read()); } /** Runs {@code callable} concurrently {@code numberOfThreads} times. */ @GwtIncompatible // concurrency private void runConcurrentTest(int numberOfThreads, Callable<@Nullable Void> callable) throws Exception { ExecutorService executorService = newFixedThreadPool(numberOfThreads); try {Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Tue Mar 17 16:11:48 GMT 2026 - 6.1K bytes - Click Count (0)