Skip to main content

AsyncExecutor

Trait AsyncExecutor 

Source
pub trait AsyncExecutor:
    Send
    + Sync
    + 'static {
    // Required methods
    fn execute(&self, job: AsyncJob) -> Result<(), AsyncExecuteError>;
    fn shutdown(&self);
}
Expand description

Runtime-neutral submission surface installed by an XLL application.

Each executor belongs to exactly one runtime generation. execute must either accept the closure exactly once or return it without running it. shutdown establishes an irreversible rejection boundary, waits until all accepted closures can no longer execute XLL code, and is idempotent. It must not detach work that can outlive XLL unload. The runtime never invokes shutdown from one of the executor’s jobs; third-party implementations that permit that case must document it themselves. execute must not run the job synchronously or wait for the job to finish before returning: controller admission remains locked until acceptance commits.

Required Methods§

Source

fn execute(&self, job: AsyncJob) -> Result<(), AsyncExecuteError>

Accepts job exactly once, or returns it without executing it.

Implementations must establish the acceptance boundary before this method returns and must not run the job synchronously.

Source

fn shutdown(&self)

Permanently rejects future jobs and waits for accepted jobs to stop.

This is idempotent and is the executor-generation unload boundary: when it returns, no accepted closure may still execute XLL code.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§