create_runtime

Function create_runtime 

Source
pub fn create_runtime() -> Result<Runtime, String>
Expand description

Create a new tokio runtime for async operations in sync context

IMPORTANT: This function detects if we’re already inside a tokio runtime (e.g., when using #tokio::main) and returns an error in that case. Use execute_async() or execute_async_verb() instead, which handle this properly.

§Errors

Returns error if runtime creation fails (rare, usually indicates system resource issues) or if called from within an existing runtime.