Skip to main content

execute_script_async

Function execute_script_async 

Source
pub async fn execute_script_async(
    config: &ScriptConfig,
    input: &ScriptInput,
) -> Result<ScriptResponse>
Expand description

Execute a script with the given input (async, non-blocking).

This is the entry point for all async callers. It never parks an OS thread: the child process is spawned with tokio::process and awaited with tokio::time::timeout.

§Arguments

  • config - Script configuration (language, source, etc.)
  • input - Structured input to send to the script

§Returns

  • Ok(ScriptResponse) - Parsed response from the script
  • Err(_) - If execution failed, timed out, or the response was invalid

§Errors

This function will return an error if:

  • The script code cannot be loaded
  • The interpreter is not installed / not on PATH
  • The script execution exceeds the timeout (the child is killed and reaped)
  • The script returns invalid JSON
  • The script exits with non-zero status