Skip to content

block_on in wasm #2741

Open
Open
@simonwarchol

Description

@simonwarchol

New to rust, so appreciate the help.

I'm trying to call block on an async function within rust and it's throwing errors, was wondering if this is possible.

Using
futures = {version="0.3.28", features=["executor"]}

use futures::executor::block_on;
pub fn test() -> Vec<f32> {
    block_on(test_diff())
}

pub async fn test_diff() -> Vec<f32> {
    let result = async_func.await;
    result
}

but getting a RuntimeError: unreachable error.

Any guidance would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions