Skip to content

Futures-based with_document #57

@LilithSilver

Description

@LilithSilver

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions