I want to use neon to perform an async task from nodejs to rust.
I want to call a function from nodejs with some data performAsyncTask(data, (err, result) => {})
and get back a result once rust has finished performing the task.
I looked at a basic async example using neon on their github: https://github.com/neon-bindings/examples/blob/main/async/native/src/lib.rs
Unfortunately, I can't seem to figure out how to access the data from the perform method in the BackgroundTask.
If I get the argument passed in from nodejs this way
let arg0 = cx.argument::<JsValue>(0)?;
, how can I access that within the perform method of the BackgroundTask?
I appreciate the help!
Thanks!