MCPcopy Create free account
hub / github.com/apache/datafusion / spawn_blocking

Method spawn_blocking

datafusion/common-runtime/src/common.rs:52–62  ·  view source on GitHub ↗
(task: T)

Source from the content-addressed store, hash-verified

50 }
51
52 pub fn spawn_blocking<T>(task: T) -> Self
53 where
54 T: FnOnce() -> R,
55 T: Send + 'static,
56 R: Send,
57 {
58 // Ok to use spawn_blocking here as SpawnedTask handles aborting/cancelling the task on Drop
59 #[expect(clippy::disallowed_methods)]
60 let inner = tokio::task::spawn_blocking(trace_block(task));
61 Self { inner }
62 }
63
64 /// Joins the task, returning the result of join (`Result<R, JoinError>`).
65 /// Same as awaiting the spawned task, but left for backwards compatibility.

Callers 2

stream_yieldsFunction · 0.45
executeMethod · 0.45

Calls 1

trace_blockFunction · 0.85

Tested by 1

stream_yieldsFunction · 0.36