background_tasks¶
- class litestar.background_tasks.BackgroundTask[原始碼]¶
基底類別:
objectA container for a 'background' task function.
Background tasks are called once a Response finishes.
- class litestar.background_tasks.BackgroundTasks[原始碼]¶
基底類別:
objectA container for multiple 'background' task functions.
Background tasks are called once a Response finishes.
- __init__(tasks: Iterable[BackgroundTask], run_in_task_group: bool = False) None[原始碼]¶
初始化
BackgroundTasks。- 參數:
tasks¶ -- An iterable of
BackgroundTaskinstances.run_in_task_group¶ -- If you set this value to
Truethan the tasks will run concurrently, using aTaskGroup. Note: This will not preserve execution order.