MCPcopy Create free account
hub / github.com/Qovery/engine / spawn_new_task

Method spawn_new_task

app/src/deployment_manager/task_context.rs:14–33  ·  view source on GitHub ↗
(task: Arc<dyn Task>)

Source from the content-addressed store, hash-verified

12
13impl TaskContext {
14 pub fn spawn_new_task(task: Arc<dyn Task>) -> TaskContext {
15 let span = Span::current();
16
17 let task_handle = tokio_utils::launch_blocking_task({
18 let task = task.clone();
19 move || {
20 let _guard = scopeguard::guard(span, |span| {
21 let _span = span.enter();
22 debug!("Task {} has terminated to run from blocking pool", task.id());
23 });
24
25 task.run();
26 }
27 });
28
29 TaskContext {
30 task,
31 _handle: task_handle,
32 }
33 }
34
35 pub async fn terminate_task(self) {
36 if self.task.is_terminated() {

Callers

nothing calls this directly

Calls 3

launch_blocking_taskFunction · 0.85
cloneMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected