Skip to content

In a module best way to deal with async #407

Open
@Norlock

Description

@Norlock

I'm working on the following project:
https://github.com/norlock/nvim-traveller-rs

But every time i try to acquire a lock it will crash it some error about thread boundary. Is there a way I can maybe create a new Lua context from inside the app? I would like to be able to generate one:

let lua_owned = mlua::Lua::from_state(lua);

I don't know if this possible to make in code, but it would be great if it is. If you have any good suggestion on how to deal with async safely I would like to know. For now I'm basically fixing my issues by having an interval run with try_lock. See:
https://github.com/Norlock/neo-api-rs/blob/bad84fba8c3114c00d26bb8927b5bc01fc12090f/src/fuzzy.rs#L491

Keep up the good work

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions