Trait tokio_rayon::AsyncThreadPool [−][src]
Extension trait that integrates Rayon’s ThreadPool
with Tokio.
This trait is sealed and cannot be implemented by external crates.
Required methods
fn spawn_async<F, R>(&self, func: F) -> AsyncRayonHandle<R>ⓘNotable traits for AsyncRayonHandle<T>
impl<T> Future for AsyncRayonHandle<T> type Output = T;
where
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,
[src]
Notable traits for AsyncRayonHandle<T>
impl<T> Future for AsyncRayonHandle<T> type Output = T;
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,
Asynchronous wrapper around Rayon’s
ThreadPool::spawn
.
Runs a function on the global Rayon thread pool with LIFO priority, produciing a future that resolves with the function’s return value.
Panics
If the task function panics, the panic will be propagated through the returned future. This will NOT trigger the Rayon thread pool’s panic handler.
If the returned handle is dropped, and the return value of func
panics
when dropped, that panic WILL trigger the thread pool’s panic
handler.
fn spawn_fifo_async<F, R>(&self, f: F) -> AsyncRayonHandle<R>ⓘNotable traits for AsyncRayonHandle<T>
impl<T> Future for AsyncRayonHandle<T> type Output = T;
where
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,
[src]
Notable traits for AsyncRayonHandle<T>
impl<T> Future for AsyncRayonHandle<T> type Output = T;
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,
Asynchronous wrapper around Rayon’s
ThreadPool::spawn_fifo
.
Runs a function on the global Rayon thread pool with FIFO priority, produciing a future that resolves with the function’s return value.
Panics
If the task function panics, the panic will be propagated through the returned future. This will NOT trigger the Rayon thread pool’s panic handler.
If the returned handle is dropped, and the return value of func
panics
when dropped, that panic WILL trigger the thread pool’s panic
handler.
Implementations on Foreign Types
impl AsyncThreadPool for ThreadPool
[src]
fn spawn_async<F, R>(&self, func: F) -> AsyncRayonHandle<R>ⓘNotable traits for AsyncRayonHandle<T>
impl<T> Future for AsyncRayonHandle<T> type Output = T;
where
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,
[src]
Notable traits for AsyncRayonHandle<T>
impl<T> Future for AsyncRayonHandle<T> type Output = T;
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,
fn spawn_fifo_async<F, R>(&self, func: F) -> AsyncRayonHandle<R>ⓘNotable traits for AsyncRayonHandle<T>
impl<T> Future for AsyncRayonHandle<T> type Output = T;
where
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,
[src]
Notable traits for AsyncRayonHandle<T>
impl<T> Future for AsyncRayonHandle<T> type Output = T;
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,