pub fn blocking<F, R>(future: F) -> RecoverableHandle<R>
where
    F: Future<Output = R> + Send + 'static,
    R: Send + 'static,
{
    bastion_executor::blocking::spawn_blocking(future, lightproc::proc_stack::ProcStack::default())
}
/// Spawns a blocking task, which will run on the blocking thread pool,
/// and returns the handle.
///
/// # Example
/// ```
/// # use std::{thread, time};
/// # #[cfg(feature = "tokio-runtime")]
/// # #[tokio::main]
/// # async fn main() {
/// #    run();    
/// # }
/// #
/// # #[cfg(not(feature = "tokio-runtime"))]
/// # fn main() {
/// #    run();    
/// # }
/// #
/// # fn run() {
/// use bastion::executor::blocking;
/// let task = blocking(async move {
///     thread::sleep(time::Duration::from_millis(3000));
/// });
/// # }
/// ```
Spawns a blocking task, which will run on the blocking thread pool,
and returns the handle.
Spawns a blocking task which will run on the blocking thread pool and returns the handle .
pub fn blocking<F, R>(future: F) -> RecoverableHandle<R>
where
    F: Future<Output = R> + Send + 'static,
    R: Send + 'static,
{
    bastion_executor::blocking::spawn_blocking(future, lightproc::proc_stack::ProcStack::default())
}
pub fn blocking < F , R > ( future : F ) -> RecoverableHandle < R > where F : Future < Output = R > + Send + ' static , R : Send + ' static , { bastion_executor :: blocking :: spawn_blocking ( future , lightproc :: proc_stack :: ProcStack :: default ( ) ) }
Spawns a blocking task, which will run on the blocking thread pool,
and returns the handle.
Spawns a blocking task which will run on the blocking thread pool and returns the handle .
future
F
future
F
example
None
use std::{thread, time};
None
#[cfg(feature = "tokio-runtime")]
None
#[tokio::main]
None
async fn main() {
None
run();    
None
}
None
#[cfg(not(feature = "tokio-runtime"))]
None
fn main() {
None
run();    
None
}
None
fn run() {
use bastion::executor::blocking;
let task = blocking(async move {
thread::sleep(time::Duration::from_millis(3000));
}).
use bastion :: executor :: blocking ; let task = blocking ( async move { thread :: sleep ( time :: Duration :: from_millis ( 3000 )) ; } ) .
}
None