Skip to content

Is it possible to call async functions? If yes how?  #876

@weezy20

Description

@weezy20

I am using a rust crate that requires the use of async functions, and so my main function looks like this:

#[neon::main]
fn main(mut cx: ModuleContext) -> NeonResult<()> {
    cx.export_function("async_fn", async_fn)?;
    Ok(())
}

I would like to .await on the async_fn, what is the way to achieve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions