←back to thread

30 points apatheticonion | 1 comments | | HN request time: 0.412s | source
Show context
CGamesPlay ◴[] No.45192815[source]
The async example in the readme is weird. It appears to be an example of tokio::sleep, where you synchronously call into your library before you sleep. Nothing about your library usage is async. In fact, the whole usage of the library is blocking, so I can't even call it from my existing async code. I'm expecting: I can call my async Rust function from JavaScript, and I can await a JavaScript async method. The example should at the very least be using `async fn main`.
replies(1): >>45218076 #
1. apatheticonion ◴[] No.45218076[source]
You're right. I've actually removed it because it doesn't make sense.

There's now `call_blocking` and `call_async` to call a JavaScript function from Rust from normal and async call sites