Open GirkovArpa opened 3 years ago
How to accomplish the same as the below using Python instead of Rust?
Rust
fn sum_async(&self, x: i32, y: i32, callback: Value) -> () { thread::spawn(move || { callback.call(None, &make_args!(x + y), None).unwrap(); }); }
JavaScript
function sum_async(a, b) { return new Promise((resolve) => { Window.this.xcall('sum_async', a, b, resolve); }); }
Exactly the same: https://docs.python.org/3/library/threading.html
Also there's https://docs.python.org/3/library/asyncio.html
How to accomplish the same as the below using Python instead of Rust?
Rust
JavaScript