Trait jlrs::traits::multitask::JuliaTask [−][src]
The JuliaTask
trait is used to create tasks that the async runtime can execute.
Implementations of this trait take the place of the closures used with the sync runtime.
Associated Types
type T: 'static + Send + Sync
[src]
The type of the result of this task. Must be the same across all implementations.
type R: ReturnChannel<T = Self::T>
[src]
The type of the sender that is used to send the result of this task back to the original caller. Must be the same across all implementations.
Required methods
#[must_use]fn run<'base, 'life0, 'life1, 'async_trait>(
&'life0 mut self,
global: Global<'base>,
frame: &'life1 mut AsyncFrame<'base>
) -> Pin<Box<dyn Future<Output = JlrsResult<Self::T>> + 'async_trait>> where
'base: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self,
global: Global<'base>,
frame: &'life1 mut AsyncFrame<'base>
) -> Pin<Box<dyn Future<Output = JlrsResult<Self::T>> + 'async_trait>> where
'base: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
The entrypoint of a task. You can use the Global
and AsyncFrame
to call arbitrary
functions from Julia. Additionally, Value::call_async
can be used to call a function
on another thread and allow other tasks to progress while awaiting the result.
Implementations that don't use Value::call_async
will block the runtime during
execution.
Provided methods
fn return_channel(&self) -> Option<&Self::R>
[src]
The return channel for this task, or None
if the result doesn't need to be returned.
Returns None
by default.