lux_lib/lua.rs
1//! Special utilities for the Lua bridge.
2
3use tokio::runtime::{Builder, Runtime};
4
5use lazy_static::lazy_static;
6
7lazy_static! {
8 static ref LUA_RUNTIME: Runtime = {
9 #[allow(clippy::expect_used)]
10 Builder::new_multi_thread()
11 .enable_all()
12 .build()
13 .expect("Failed to initialise Lua runtime")
14 };
15}
16
17pub fn lua_runtime() -> &'static Runtime {
18 &LUA_RUNTIME
19}