pub fn init(q_js_rt: &QuickJsRuntimeAdapter) -> Result<(), JsError>
Expand description

provides the setImmediate methods for the runtime

Example

use quickjs_runtime::builder::QuickJsRuntimeBuilder;
use hirofa_utils::js_utils::Script;
use std::time::Duration;
let rt = QuickJsRuntimeBuilder::new().build();
rt.eval(Script::new("test_immediate.es", "setImmediate(() => {console.log('immediate logging')});"));
std::thread::sleep(Duration::from_secs(1));