- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 11 for write_notification (0.23 sec)
-
docs_src/background_tasks/tutorial001.py
app = FastAPI() def write_notification(email: str, message=""): with open("log.txt", mode="w") as email_file: content = f"notification for {email}: {message}" email_file.write(content) @app.post("/send-notification/{email}") async def send_notification(email: str, background_tasks: BackgroundTasks): background_tasks.add_task(write_notification, email, message="some notification")
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 519 bytes - Viewed (0) -
fastapi/background.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Tue Apr 02 02:48:51 GMT 2024 - 1.7K bytes - Viewed (0) -
docs/ru/docs/tutorial/background-tasks.md
```Python hl_lines="14" {!../../../docs_src/background_tasks/tutorial001.py!} ``` `.add_task()` принимает следующие аргументы: * Функцию, которая будет выполнена в фоне (`write_notification`). Обратите внимание, что передается объект функции, без скобок. * Любое упорядоченное количество аргументов, которые принимает функция (`email`).
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Tue Jan 09 15:52:07 GMT 2024 - 8K bytes - Viewed (0) -
docs/en/docs/tutorial/background-tasks.md
```Python hl_lines="14" {!../../../docs_src/background_tasks/tutorial001.py!} ``` `.add_task()` receives as arguments: * A task function to be run in the background (`write_notification`). * Any sequence of arguments that should be passed to the task function in order (`email`). * Any keyword arguments that should be passed to the task function (`message="some notification"`). ## Dependency Injection
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Tue Oct 17 05:59:11 GMT 2023 - 5.6K bytes - Viewed (0) -
docs/em/docs/tutorial/background-tasks.md
## 🚮 🖥 📋 🔘 👆 *➡ 🛠️ 🔢*, 🚶♀️ 👆 📋 🔢 *🖥 📋* 🎚 ⏮️ 👩🔬 `.add_task()`: ```Python hl_lines="14" {!../../../docs_src/background_tasks/tutorial001.py!} ``` `.add_task()` 📨 ❌: * 📋 🔢 🏃 🖥 (`write_notification`). * 🙆 🔁 ❌ 👈 🔜 🚶♀️ 📋 🔢 ✔ (`email`). * 🙆 🇨🇻 ❌ 👈 🔜 🚶♀️ 📋 🔢 (`message="some notification"`). ## 🔗 💉
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Apr 01 09:26:04 GMT 2023 - 4.1K bytes - Viewed (0) -
docs/fr/docs/tutorial/background-tasks.md
```Python hl_lines="14" {!../../../docs_src/background_tasks/tutorial001.py!} ``` `.add_task()` reçoit comme arguments : * Une fonction de tâche à exécuter en arrière-plan (`write_notification`). * Les arguments positionnels à passer à la fonction de tâche dans l'ordre (`email`). * Les arguments nommés à passer à la fonction de tâche (`message="some notification"`). ## Injection de dépendances
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu May 12 00:06:16 GMT 2022 - 5.7K bytes - Viewed (0) -
docs/ko/docs/tutorial/background-tasks.md
_경로 작동 함수_ 내에서 작업 함수를 `.add_task()` 함수 통해 _백그라운드 작업_ 개체에 전달합니다. ```Python hl_lines="14" {!../../../docs_src/background_tasks/tutorial001.py!} ``` `.add_task()` 함수는 다음과 같은 인자를 받습니다 : - 백그라운드에서 실행되는 작업 함수 (`write_notification`). - 작업 함수에 순서대로 전달되어야 하는 일련의 인자 (`email`). - 작업 함수에 전달되어야하는 모든 키워드 인자 (`message="some notification"`). ## 의존성 주입
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sun Feb 11 13:48:31 GMT 2024 - 5.7K bytes - Viewed (0) -
docs/pt/docs/tutorial/background-tasks.md
```Python hl_lines="14" {!../../../docs_src/background_tasks/tutorial001.py!} ``` `.add_task()` recebe como argumentos: - Uma função de tarefa a ser executada em segundo plano (`write_notification`). - Qualquer sequência de argumentos que deve ser passada para a função de tarefa na ordem (`email`). - Quaisquer argumentos nomeados que devem ser passados para a função de tarefa (`mensagem = "alguma notificação"`).
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Mon May 09 23:44:32 GMT 2022 - 5.3K bytes - Viewed (0) -
docs/de/docs/tutorial/background-tasks.md
```Python hl_lines="14" {!../../../docs_src/background_tasks/tutorial001.py!} ``` `.add_task()` erhält als Argumente: * Eine Taskfunktion, die im Hintergrund ausgeführt wird (`write_notification`). * Eine beliebige Folge von Argumenten, die der Reihe nach an die Taskfunktion übergeben werden sollen (`email`). * Alle Schlüsselwort-Argumente, die an die Taskfunktion übergeben werden sollen (`message="some notification"`).
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jan 12 14:15:29 GMT 2024 - 6.4K bytes - Viewed (0) -
docs/zh/docs/tutorial/background-tasks.md
``` ## 添加后台任务 在你的 *路径操作函数* 里,用 `.add_task()` 方法将任务函数传到 *后台任务* 对象中: ```Python hl_lines="14" {!../../../docs_src/background_tasks/tutorial001.py!} ``` `.add_task()` 接收以下参数: * 在后台运行的任务函数(`write_notification`)。 * 应按顺序传递给任务函数的任意参数序列(`email`)。 * 应传递给任务函数的任意关键字参数(`message="some notification"`)。 ## 依赖注入 使用 `BackgroundTasks` 也适用于依赖注入系统,你可以在多个级别声明 `BackgroundTasks` 类型的参数:在 *路径操作函数* 里,在依赖中(可依赖),在子依赖中,等等。
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Tue Oct 17 05:59:11 GMT 2023 - 5K bytes - Viewed (0)