Trait jlrs::call::CallAsync

source ·
pub trait CallAsync<'data>: Call<'data> {
Show 16 methods // Required methods unsafe fn call_async<'target, 'value, 'life0, 'async_trait, V>( self, frame: &'life0 mut AsyncGcFrame<'target>, args: V ) -> Pin<Box<dyn Future<Output = JuliaResult<'target, 'data>> + 'async_trait>> where V: AsRef<[Value<'value, 'data>]> + 'async_trait, Self: 'async_trait, 'target: 'async_trait, 'value: 'async_trait, 'life0: 'async_trait; unsafe fn schedule_async<'target, 'value, V>( self, frame: &mut AsyncGcFrame<'target>, args: V ) -> JuliaResult<'target, 'data, Task<'target>> where V: AsRef<[Value<'value, 'data>]>; unsafe fn call_async_interactive<'target, 'value, 'life0, 'async_trait, V>( self, frame: &'life0 mut AsyncGcFrame<'target>, args: V ) -> Pin<Box<dyn Future<Output = JuliaResult<'target, 'data>> + 'async_trait>> where V: AsRef<[Value<'value, 'data>]> + 'async_trait, Self: 'async_trait, 'target: 'async_trait, 'value: 'async_trait, 'life0: 'async_trait; unsafe fn schedule_async_interactive<'target, 'value, V>( self, frame: &mut AsyncGcFrame<'target>, args: V ) -> JuliaResult<'target, 'data, Task<'target>> where V: AsRef<[Value<'value, 'data>]>; unsafe fn call_async_local<'target, 'value, 'life0, 'async_trait, V>( self, frame: &'life0 mut AsyncGcFrame<'target>, args: V ) -> Pin<Box<dyn Future<Output = JuliaResult<'target, 'data>> + 'async_trait>> where V: AsRef<[Value<'value, 'data>]> + 'async_trait, Self: 'async_trait, 'target: 'async_trait, 'value: 'async_trait, 'life0: 'async_trait; unsafe fn schedule_async_local<'target, 'value, V>( self, frame: &mut AsyncGcFrame<'target>, args: V ) -> JuliaResult<'target, 'data, Task<'target>> where V: AsRef<[Value<'value, 'data>]>; unsafe fn call_async_main<'target, 'value, 'life0, 'async_trait, V>( self, frame: &'life0 mut AsyncGcFrame<'target>, args: V ) -> Pin<Box<dyn Future<Output = JuliaResult<'target, 'data>> + 'async_trait>> where V: AsRef<[Value<'value, 'data>]> + 'async_trait, Self: 'async_trait, 'target: 'async_trait, 'value: 'async_trait, 'life0: 'async_trait; unsafe fn schedule_async_main<'target, 'value, V>( self, frame: &mut AsyncGcFrame<'target>, args: V ) -> JuliaResult<'target, 'data, Task<'target>> where V: AsRef<[Value<'value, 'data>]>; // Provided methods unsafe fn call_async_tracked<'target, 'value, 'life0, 'async_trait, V>( self, frame: &'life0 mut AsyncGcFrame<'target>, args: V ) -> Pin<Box<dyn Future<Output = JlrsResult<JuliaResult<'target, 'data>>> + 'async_trait>> where V: AsRef<[Value<'value, 'data>]> + 'async_trait, Self: 'async_trait, 'target: 'async_trait, 'value: 'async_trait, 'life0: 'async_trait { ... } unsafe fn schedule_async_tracked<'target, 'value, V, T>( self, frame: &mut AsyncGcFrame<'target>, args: V ) -> JlrsResult<JuliaResult<'target, 'data, Task<'target>>> where V: AsRef<[Value<'value, 'data>]>, T: Target<'target> { ... } unsafe fn call_async_interactive_tracked<'target, 'value, 'life0, 'async_trait, V>( self, frame: &'life0 mut AsyncGcFrame<'target>, args: V ) -> Pin<Box<dyn Future<Output = JlrsResult<JuliaResult<'target, 'data>>> + 'async_trait>> where V: AsRef<[Value<'value, 'data>]> + 'async_trait, Self: 'async_trait, 'target: 'async_trait, 'value: 'async_trait, 'life0: 'async_trait { ... } unsafe fn schedule_async_interactive_tracked<'target, 'value, V, T>( self, frame: &mut AsyncGcFrame<'target>, args: V ) -> JlrsResult<JuliaResult<'target, 'data, Task<'target>>> where V: AsRef<[Value<'value, 'data>]>, T: Target<'target> { ... } unsafe fn call_async_local_tracked<'target, 'value, 'life0, 'async_trait, V>( self, frame: &'life0 mut AsyncGcFrame<'target>, args: V ) -> Pin<Box<dyn Future<Output = JlrsResult<JuliaResult<'target, 'data>>> + 'async_trait>> where V: AsRef<[Value<'value, 'data>]> + 'async_trait, Self: 'async_trait, 'target: 'async_trait, 'value: 'async_trait, 'life0: 'async_trait { ... } unsafe fn schedule_async_local_tracked<'target, 'value, V, T>( self, frame: &mut AsyncGcFrame<'target>, args: V ) -> JlrsResult<JuliaResult<'target, 'data, Task<'target>>> where V: AsRef<[Value<'value, 'data>]>, T: Target<'target> { ... } unsafe fn call_async_main_tracked<'target, 'value, 'life0, 'async_trait, V>( self, frame: &'life0 mut AsyncGcFrame<'target>, args: V ) -> Pin<Box<dyn Future<Output = JlrsResult<JuliaResult<'target, 'data>>> + 'async_trait>> where V: AsRef<[Value<'value, 'data>]> + 'async_trait, Self: 'async_trait, 'target: 'async_trait, 'value: 'async_trait, 'life0: 'async_trait { ... } unsafe fn schedule_async_main_tracked<'target, 'value, V, T>( self, frame: &mut AsyncGcFrame<'target>, args: V ) -> JlrsResult<JuliaResult<'target, 'data, Task<'target>>> where V: AsRef<[Value<'value, 'data>]>, T: Target<'target> { ... }
}
Expand description

This trait provides async methods to create and schedule Tasks that resolve when the Task has completed. Sync methods are also provided which only schedule the Task, those methods should only be used from PersistentTask::init.

Required Methods§

source

unsafe fn call_async<'target, 'value, 'life0, 'async_trait, V>( self, frame: &'life0 mut AsyncGcFrame<'target>, args: V ) -> Pin<Box<dyn Future<Output = JuliaResult<'target, 'data>> + 'async_trait>>where V: AsRef<[Value<'value, 'data>]> + 'async_trait, Self: 'async_trait, 'target: 'async_trait, 'value: 'async_trait, 'life0: 'async_trait,

Creates and schedules a new task with Base.Threads.@spawn, and returns a future that resolves when this task is finished.

Since Julia 1.9 this task is spawned on the :default thread pool.

Safety: this method lets you call arbitrary Julia functions which can’t be checked for correctness. More information can be found in the safety module. This method doesn’t check if any of the arguments is currently borrowed from Rust.

source

unsafe fn schedule_async<'target, 'value, V>( self, frame: &mut AsyncGcFrame<'target>, args: V ) -> JuliaResult<'target, 'data, Task<'target>>where V: AsRef<[Value<'value, 'data>]>,

Does the same thing as CallAsync::call_async, but the task is returned rather than an awaitable Future. This method should only be called in PersistentTask::init, otherwise it’s not guaranteed this task can make progress.

Since Julia 1.9 this task is spawned on the :default thread pool.

Safety: this method lets you call arbitrary Julia functions which can’t be checked for correctness. More information can be found in the safety module. This method doesn’t check if any of the arguments is currently borrowed from Rust.

source

unsafe fn call_async_interactive<'target, 'value, 'life0, 'async_trait, V>( self, frame: &'life0 mut AsyncGcFrame<'target>, args: V ) -> Pin<Box<dyn Future<Output = JuliaResult<'target, 'data>> + 'async_trait>>where V: AsRef<[Value<'value, 'data>]> + 'async_trait, Self: 'async_trait, 'target: 'async_trait, 'value: 'async_trait, 'life0: 'async_trait,

Call a function on another thread with the given arguments. This method uses Base.Threads.@spawn to call the given function on another thread but return immediately. While awaiting the result the async runtime can work on other tasks, the current task resumes after the function call on the other thread completes.

This task is spawned on the :interactive thread pool.

Safety: this method lets you call arbitrary Julia functions which can’t be checked for correctness. More information can be found in the safety module. This method doesn’t check if any of the arguments is currently borrowed from Rust.

source

unsafe fn schedule_async_interactive<'target, 'value, V>( self, frame: &mut AsyncGcFrame<'target>, args: V ) -> JuliaResult<'target, 'data, Task<'target>>where V: AsRef<[Value<'value, 'data>]>,

Does the same thing as CallAsync::call_async, but the task is returned rather than an awaitable Future. This method should only be called in PersistentTask::init, otherwise it’s not guaranteed this task can make progress.

This task is spawned on the :interactive thread pool.

Safety: this method lets you call arbitrary Julia functions which can’t be checked for correctness. More information can be found in the safety module. This method doesn’t check if any of the arguments is currently borrowed from Rust.

source

unsafe fn call_async_local<'target, 'value, 'life0, 'async_trait, V>( self, frame: &'life0 mut AsyncGcFrame<'target>, args: V ) -> Pin<Box<dyn Future<Output = JuliaResult<'target, 'data>> + 'async_trait>>where V: AsRef<[Value<'value, 'data>]> + 'async_trait, Self: 'async_trait, 'target: 'async_trait, 'value: 'async_trait, 'life0: 'async_trait,

Call a function with the given arguments in an @async block. Like call_async, the function is not called on the main thread, but on a separate thread that handles all tasks created by this method. This method should only be used with functions that do very little computational work but mostly spend their time waiting on IO.

Since Julia 1.9 this task is spawned on the :interactive thread pool.

Safety: this method lets you call arbitrary Julia functions which can’t be checked for correctness. More information can be found in the safety module. This method doesn’t check if any of the arguments is currently borrowed from Rust.

source

unsafe fn schedule_async_local<'target, 'value, V>( self, frame: &mut AsyncGcFrame<'target>, args: V ) -> JuliaResult<'target, 'data, Task<'target>>where V: AsRef<[Value<'value, 'data>]>,

Does the same thing as CallAsync::call_async_local, but the task is returned rather than an awaitable Future. This method should only be called in PersistentTask::init, otherwise it’s not guaranteed this task can make progress.

Since Julia 1.9 this task is spawned on the :interactive thread pool.

Safety: this method lets you call arbitrary Julia functions which can’t be checked for correctness. More information can be found in the safety module. This method doesn’t check if any of the arguments is currently borrowed from Rust.

source

unsafe fn call_async_main<'target, 'value, 'life0, 'async_trait, V>( self, frame: &'life0 mut AsyncGcFrame<'target>, args: V ) -> Pin<Box<dyn Future<Output = JuliaResult<'target, 'data>> + 'async_trait>>where V: AsRef<[Value<'value, 'data>]> + 'async_trait, Self: 'async_trait, 'target: 'async_trait, 'value: 'async_trait, 'life0: 'async_trait,

Call a function with the given arguments in an @async block. The task is scheduled on the main thread. This method should only be used with functions that must run on the main thread. The runtime is blocked while this task is active.

Since Julia 1.9 this task is spawned on the :interactive thread pool.

Safety: this method lets you call arbitrary Julia functions which can’t be checked for correctness. More information can be found in the safety module. This method doesn’t check if any of the arguments is currently borrowed from Rust.

source

unsafe fn schedule_async_main<'target, 'value, V>( self, frame: &mut AsyncGcFrame<'target>, args: V ) -> JuliaResult<'target, 'data, Task<'target>>where V: AsRef<[Value<'value, 'data>]>,

Does the same thing as CallAsync::call_async_main, but the task is returned rather than an awaitable Future. This method should only be called in PersistentTask::init, otherwise it’s not guaranteed this task can make progress.

Since Julia 1.9 this task is spawned on the :interactive thread pool.

Safety: this method lets you call arbitrary Julia functions which can’t be checked for correctness. More information can be found in the safety module. This method doesn’t check if any of the arguments is currently borrowed from Rust.

Provided Methods§

source

unsafe fn call_async_tracked<'target, 'value, 'life0, 'async_trait, V>( self, frame: &'life0 mut AsyncGcFrame<'target>, args: V ) -> Pin<Box<dyn Future<Output = JlrsResult<JuliaResult<'target, 'data>>> + 'async_trait>>where V: AsRef<[Value<'value, 'data>]> + 'async_trait, Self: 'async_trait, 'target: 'async_trait, 'value: 'async_trait, 'life0: 'async_trait,

Creates and schedules a new task with Base.Threads.@spawn, and returns a future that resolves when this task is finished.

Since Julia 1.9 this task is spawned on the :default thread pool.

This method checks if any of the arguments is currently borrowed from Rust, and returns an AccessError::BorrowError if any of the arguments is.

Safety: this method lets you call arbitrary Julia functions which can’t be checked for correctness. More information can be found in the safety module.

source

unsafe fn schedule_async_tracked<'target, 'value, V, T>( self, frame: &mut AsyncGcFrame<'target>, args: V ) -> JlrsResult<JuliaResult<'target, 'data, Task<'target>>>where V: AsRef<[Value<'value, 'data>]>, T: Target<'target>,

Does the same thing as CallAsync::call_async, but the task is returned rather than an awaitable Future. This method should only be called in PersistentTask::init, otherwise it’s not guaranteed this task can make progress.

Since Julia 1.9 this task is spawned on the :default thread pool.

Safety: this method lets you call arbitrary Julia functions which can’t be checked for correctness. More information can be found in the safety module.

This method checks if any of the arguments is currently borrowed from Rust, and returns an AccessError::BorrowError if any of the arguments is.

source

unsafe fn call_async_interactive_tracked<'target, 'value, 'life0, 'async_trait, V>( self, frame: &'life0 mut AsyncGcFrame<'target>, args: V ) -> Pin<Box<dyn Future<Output = JlrsResult<JuliaResult<'target, 'data>>> + 'async_trait>>where V: AsRef<[Value<'value, 'data>]> + 'async_trait, Self: 'async_trait, 'target: 'async_trait, 'value: 'async_trait, 'life0: 'async_trait,

Call a function on another thread with the given arguments. This method uses Base.Threads.@spawn to call the given function on another thread but return immediately. While awaiting the result the async runtime can work on other tasks, the current task resumes after the function call on the other thread completes.

This task is spawned on the :interactive thread pool.

Safety: this method lets you call arbitrary Julia functions which can’t be checked for correctness. More information can be found in the safety module.

This method checks if any of the arguments is currently borrowed from Rust, and returns an AccessError::BorrowError if any of the arguments is.

source

unsafe fn schedule_async_interactive_tracked<'target, 'value, V, T>( self, frame: &mut AsyncGcFrame<'target>, args: V ) -> JlrsResult<JuliaResult<'target, 'data, Task<'target>>>where V: AsRef<[Value<'value, 'data>]>, T: Target<'target>,

Does the same thing as CallAsync::call_async, but the task is returned rather than an awaitable Future. This method should only be called in PersistentTask::init, otherwise it’s not guaranteed this task can make progress.

This task is spawned on the :interactive thread pool.

Safety: this method lets you call arbitrary Julia functions which can’t be checked for correctness. More information can be found in the safety module.

This method checks if any of the arguments is currently borrowed from Rust, and returns an AccessError::BorrowError if any of the arguments is.

source

unsafe fn call_async_local_tracked<'target, 'value, 'life0, 'async_trait, V>( self, frame: &'life0 mut AsyncGcFrame<'target>, args: V ) -> Pin<Box<dyn Future<Output = JlrsResult<JuliaResult<'target, 'data>>> + 'async_trait>>where V: AsRef<[Value<'value, 'data>]> + 'async_trait, Self: 'async_trait, 'target: 'async_trait, 'value: 'async_trait, 'life0: 'async_trait,

Call a function with the given arguments in an @async block. Like call_async, the function is not called on the main thread, but on a separate thread that handles all tasks created by this method. This method should only be used with functions that do very little computational work but mostly spend their time waiting on IO.

Since Julia 1.9 this task is spawned on the :interactive thread pool.

Safety: this method lets you call arbitrary Julia functions which can’t be checked for correctness. More information can be found in the safety module.

This method checks if any of the arguments is currently borrowed from Rust, and returns an AccessError::BorrowError if any of the arguments is.

source

unsafe fn schedule_async_local_tracked<'target, 'value, V, T>( self, frame: &mut AsyncGcFrame<'target>, args: V ) -> JlrsResult<JuliaResult<'target, 'data, Task<'target>>>where V: AsRef<[Value<'value, 'data>]>, T: Target<'target>,

Does the same thing as CallAsync::call_async_local, but the task is returned rather than an awaitable Future. This method should only be called in PersistentTask::init, otherwise it’s not guaranteed this task can make progress.

Since Julia 1.9 this task is spawned on the :interactive thread pool.

Safety: this method lets you call arbitrary Julia functions which can’t be checked for correctness. More information can be found in the safety module.

This method checks if any of the arguments is currently borrowed from Rust, and returns an AccessError::BorrowError if any of the arguments is.

source

unsafe fn call_async_main_tracked<'target, 'value, 'life0, 'async_trait, V>( self, frame: &'life0 mut AsyncGcFrame<'target>, args: V ) -> Pin<Box<dyn Future<Output = JlrsResult<JuliaResult<'target, 'data>>> + 'async_trait>>where V: AsRef<[Value<'value, 'data>]> + 'async_trait, Self: 'async_trait, 'target: 'async_trait, 'value: 'async_trait, 'life0: 'async_trait,

Call a function with the given arguments in an @async block. The task is scheduled on the main thread. This method should only be used with functions that must run on the main thread. The runtime is blocked while this task is active.

Since Julia 1.9 this task is spawned on the :interactive thread pool.

Safety: this method lets you call arbitrary Julia functions which can’t be checked for correctness. More information can be found in the safety module.

This method checks if any of the arguments is currently borrowed from Rust, and returns an AccessError::BorrowError if any of the arguments is.

source

unsafe fn schedule_async_main_tracked<'target, 'value, V, T>( self, frame: &mut AsyncGcFrame<'target>, args: V ) -> JlrsResult<JuliaResult<'target, 'data, Task<'target>>>where V: AsRef<[Value<'value, 'data>]>, T: Target<'target>,

Does the same thing as CallAsync::call_async_main, but the task is returned rather than an awaitable Future. This method should only be called in PersistentTask::init, otherwise it’s not guaranteed this task can make progress.

Since Julia 1.9 this task is spawned on the :interactive thread pool.

Safety: this method lets you call arbitrary Julia functions which can’t be checked for correctness. More information can be found in the safety module.

This method checks if any of the arguments is currently borrowed from Rust, and returns an AccessError::BorrowError if any of the arguments is.

Implementors§

source§

impl<'data> CallAsync<'data> for Function<'_, 'data>

source§

impl<'data> CallAsync<'data> for Value<'_, 'data>

source§

impl<'data> CallAsync<'data> for WithKeywords<'_, 'data>