INNER CODE UNIT · Rust
spawn_dataplane
Augani/dory · dory-core/ffi/src/lib.rs:254
fn spawn_dataplane<B: dory_dataplane::Backend>(
listen_fd: i32,
backend: std::sync::Arc<B>,
gpu_supported: bool,
activity: Option<dory_dataplane::serve::ActivityReporter>,
) -> std::sync::Arc<DoryDataplane> {
let runtime = tokio::runtime::Builder::new_multi_thread()
.worker_threads(2)
.enable_all()
.build()
.expect("build dataplane runtime");
let opts = std::sync::Arc::new(dory_dataplane::ServeOpts {
gpu_supported,
activity,
});
let task = runtime.spawn(async move {
// The exported signatures return a bare Arc (no error channel), so a dead listener fd or
// bind failure must at least be visible in the daemon log rather than vanish.