I'm constantly using the following construction:
let something = tokio::task::spawn_blocking(move || {
handle.with_document(|d| {
// ... do some stuff
})
})
.await.unwrap();
Would it be possible to have a version that is futures-compatible, so I could call it like this?
let something = handle.with_document(|d| {
// ... do some stuff
}).await;
If that's desired, I'd recommend the old one be called blocking_with_document to really emphasize that it blocks, and the new renamed to with_document to match rust's naming (though that would be an API change).
I'm constantly using the following construction:
Would it be possible to have a version that is futures-compatible, so I could call it like this?
If that's desired, I'd recommend the old one be called
blocking_with_documentto really emphasize that it blocks, and the new renamed towith_documentto match rust's naming (though that would be an API change).