rlua-async

Crates.iorlua-async
lib.rsrlua-async
version0.5.0
sourcesrc
created_at2020-04-04 05:38:57.628706
updated_at2022-03-17 15:05:47.673717
descriptionAsync support for rlua, via coroutines
homepage
repositoryhttps://github.com/Ekleog/rlua-async
max_upload_size
id226147
size37,557
Léo Gaspard (Ekleog)

documentation

README

rlua-async Crates.io Documentation

rlua-async provides a way for asynchronous Rust code using rlua to seamlessly interface with Lua code, the only condition being that the Lua code must not make use of coroutines, as it is the way the async handling is proxied through Lua.

Make async builtins available to Lua code

The first thing you need to do is to make async builtins available to Lua code. You can do it via eg. ContextExt::create_async_function.

Once these builtins are available, they can be called by Lua code. This Lua code must not use coroutines, as the coroutines are an essential part of how rlua-async works internally.

Call Lua code asynchronously

In addition to this, to actually make the code async, it is also required to retrieve a Future when trying to call functions -- otherwise, evaluation is not going to be asynchronous.

To do that, you can use methods like FunctionExt::call_async.

Changelog

See the Changelog for more details.

Commit count: 36

cargo fmt