Skip to main content

blocking

Function blocking 

Source
pub async fn blocking<T: Send + 'static>(
    work: impl FnOnce() -> Result<T, ToolExecutionError> + Send + 'static,
) -> Result<T, ToolExecutionError>
Expand description

Run work on a new thread and await its answer. A panic in work becomes an error.