let async_result = alef_magnus_run_without_gvl(move || -> Result<_, String> {
let rt = tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()
.map_err(|e| e.to_string())?;
{% if has_error -%}
rt.block_on(async { {{ core_call }}.await }).map_err(|e| e.to_string())
{%- else -%}
Ok(rt.block_on(async { {{ core_call }}.await }))
{%- endif %}
});
let result = async_result.map_err(|message| magnus::Error::new(unsafe { Ruby::get_unchecked() }.exception_runtime_error(), message))?;
Ok({{ wrap }})