You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the great project. It has been a smooth experience so far.
I am looking to provide an async function on the JavaScript side and it seems it is possible with both 'AsyncTask' and 'tokio + async fn'. I'm curious if there are factors to consider when choosing?
If I were to guess, I would say that 'async fn' is simpler and should be used if the user is happy including Tokio and doesn't need abort signals or 'finally' style clean up? But otherwise AsyncTask should be used instead as that doesn't require Tokio? It would be nice to have a little info box in the docs which explicitly lays out the considerations. I could try to write one if that would be useful but I have limited experience here.
Edit: Hmm, AsyncTask puts you on a libuv thread which is good for moving calculations off the main thread but doesn't help with using further async functionality at that point.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Thanks for the great project. It has been a smooth experience so far.
I am looking to provide an async function on the JavaScript side and it seems it is possible with both 'AsyncTask' and 'tokio + async fn'. I'm curious if there are factors to consider when choosing?
If I were to guess, I would say that 'async fn' is simpler and should be used if the user is happy including Tokio and doesn't need abort signals or 'finally' style clean up? But otherwise AsyncTask should be used instead as that doesn't require Tokio? It would be nice to have a little info box in the docs which explicitly lays out the considerations. I could try to write one if that would be useful but I have limited experience here.
Edit: Hmm, AsyncTask puts you on a libuv thread which is good for moving calculations off the main thread but doesn't help with using further async functionality at that point.
Beta Was this translation helpful? Give feedback.
All reactions