arci-ros2 0.1.0

arci implementation using ROS2
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::thread;

use futures::future::Future;

// https://github.com/openrr/openrr/pull/501#discussion_r746183161
pub(crate) fn spawn_blocking<T: Send + 'static>(
    future: impl Future<Output = T> + Send + 'static,
) -> thread::JoinHandle<T> {
    std::thread::spawn(move || {
        tokio::runtime::Builder::new_current_thread()
            .enable_all()
            .build()
            .unwrap()
            .block_on(future)
    })
}