- Sort Score
- Num 10 results
- Language All
Results 471 - 480 of 1,111 for sync (0.04 seconds)
-
docs_src/generate_clients/tutorial002_py310.py
async def create_item(item: Item): return {"message": "Item received"} @app.get("/items/", response_model=list[Item], tags=["items"]) async def get_items(): return [ {"name": "Plumbus", "price": 3}, {"name": "Portal Gun", "price": 9001}, ] @app.post("/users/", response_model=ResponseMessage, tags=["users"]) async def create_user(user: User):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 730 bytes - Click Count (0) -
docs/es/docs/tutorial/stream-json-lines.md
/// ### *path operation functions* no-async { #non-async-path-operation-functions } También puedes usar funciones `def` regulares (sin `async`), y usar `yield` de la misma forma. FastAPI se asegurará de que se ejecute correctamente para que no bloquee el event loop. Como en este caso la función no es async, el tipo de retorno correcto sería `Iterable[Item]`:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:12:26 GMT 2026 - 4.6K bytes - Click Count (0) -
docs/en/docs/tutorial/stream-json-lines.md
/// ### Non-async *path operation functions* { #non-async-path-operation-functions } You can also use regular `def` functions (without `async`), and use `yield` the same way. FastAPI will make sure it's run correctly so that it doesn't block the event loop. As in this case the function is not async, the right return type would be `Iterable[Item]`:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 4.3K bytes - Click Count (0) -
docs_src/security/tutorial004_an_py310.py
if user is None: raise credentials_exception return user async def get_current_active_user( current_user: Annotated[User, Depends(get_current_user)], ): if current_user.disabled: raise HTTPException(status_code=400, detail="Inactive user") return current_user @app.post("/token") async def login_for_access_token( form_data: Annotated[OAuth2PasswordRequestForm, Depends()],Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 18:10:35 GMT 2026 - 4.2K bytes - Click Count (0) -
tensorflow/c/eager/c_api_remote_test.cc
TestRemoteExecuteSilentCopiesOp(/*async=*/false, /*remote=*/true); } TEST(CAPI, RemoteExecuteSilentCopiesAsync) { TestRemoteExecuteSilentCopiesOp(/*async=*/true, /*remote=*/true); } TEST(CAPI, RemoteExecuteSilentCopiesLocal) { TestRemoteExecuteSilentCopiesOp(/*async=*/false, /*remote=*/false); } TEST(CAPI, RemoteExecuteSilentCopiesLocalAsync) { TestRemoteExecuteSilentCopiesOp(/*async=*/true, /*remote=*/false); }
Created: Tue Apr 07 12:39:13 GMT 2026 - Last Modified: Wed Aug 12 00:14:22 GMT 2020 - 5.4K bytes - Click Count (0) -
docs/uk/docs/tutorial/request-files.md
* Це особливо корисно, якщо ви виконаєте `await myfile.read()` один раз, а потім потрібно знову прочитати вміст. * `close()`: Закриває файл. Оскільки всі ці методи є асинхронними `async` методами, вам потрібно їх «await»-ити. Наприклад, всередині `async` *функції операції шляху* ви можете отримати вміст за допомогою: ```Python contents = await myfile.read() ```
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:27:41 GMT 2026 - 11K bytes - Click Count (0) -
docs_src/generate_clients/tutorial003_py310.py
async def create_item(item: Item): return {"message": "Item received"} @app.get("/items/", response_model=list[Item], tags=["items"]) async def get_items(): return [ {"name": "Plumbus", "price": 3}, {"name": "Portal Gun", "price": 9001}, ] @app.post("/users/", response_model=ResponseMessage, tags=["users"]) async def create_user(user: User):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 914 bytes - Click Count (0) -
docs_src/request_files/tutorial002_an_py310.py
app = FastAPI() @app.post("/files/") async def create_files(files: Annotated[list[bytes], File()]): return {"file_sizes": [len(file) for file in files]} @app.post("/uploadfiles/") async def create_upload_files(files: list[UploadFile]): return {"filenames": [file.filename for file in files]} @app.get("/") async def main(): content = """ <body>
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 826 bytes - Click Count (0) -
docs/uk/docs/tutorial/stream-json-lines.md
/// ### Не-async *функції операцій шляху* { #non-async-path-operation-functions } Ви також можете використовувати звичайні функції `def` (без `async`) і використовувати `yield` так само. FastAPI подбає про коректне виконання, щоб це не блокувало цикл подій. Оскільки в цьому випадку функція не є async, правильним типом повернення буде `Iterable[Item]`:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:25:54 GMT 2026 - 6.6K bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/dependencies/index.md
當你在「大型程式碼庫」中,於許多「路徑操作」反覆使用「相同的依賴」時,這會特別有用。 ## 要不要使用 `async` { #to-async-or-not-to-async } 因為依賴也會由 **FastAPI** 呼叫(就像你的「路徑操作函式」),所以在定義函式時套用相同的規則。 你可以使用 `async def` 或一般的 `def`。 而且你可以在一般 `def` 的「路徑操作函式」中宣告 `async def` 的依賴,或在 `async def` 的「路徑操作函式」中宣告 `def` 的依賴,等等。 都沒關係。**FastAPI** 會知道該怎麼做。 /// note | 注意 如果你不熟悉,請參考文件中的 [Async: "In a hurry?"](../../async.md#in-a-hurry) 一節,瞭解 `async` 與 `await`。 ///Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 8.9K bytes - Click Count (0)