Skip to content

Async functions in a shared library panic with "there is no reactor running" #99

@zmiiGorinich

Description

@zmiiGorinich

If I create an async function in my dynamically loaded library, stabbify it with
#[stabby::stabby]
#[stabby::export]
and await for it in the main, the function panics on the calls to tokio::spawn or tokio::sleep.
I can do an await on another async in this library function though.
tokio::runtime::Handle::try_current() invoked from the library returns an error.
What is the right way to do async in this arrangement?

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