mirror of
https://github.com/lune-org/mlua-luau-scheduler.git
synced 2025-04-10 21:40:55 +01:00
Only use glob import for preludes
This commit is contained in:
parent
4fc7a31b32
commit
8ec2a647e4
1 changed files with 7 additions and 6 deletions
|
@ -1,12 +1,13 @@
|
||||||
use std::{cell::Cell, rc::Rc, sync::Arc};
|
use std::{cell::Cell, rc::Rc, sync::Arc};
|
||||||
|
|
||||||
use mlua::prelude::*;
|
use mlua::prelude::*;
|
||||||
|
use smol::prelude::*;
|
||||||
|
|
||||||
use smol::{
|
use smol::{
|
||||||
channel::{Receiver, Sender},
|
block_on,
|
||||||
future::{yield_now, FutureExt},
|
channel::{unbounded, Receiver, Sender},
|
||||||
lock::Mutex,
|
lock::Mutex,
|
||||||
stream::StreamExt,
|
Executor, LocalExecutor,
|
||||||
*,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
|
@ -37,12 +38,12 @@ impl<'lua> Runtime<'lua> {
|
||||||
let queue_status = Rc::new(Cell::new(false));
|
let queue_status = Rc::new(Cell::new(false));
|
||||||
let queue_spawn = Rc::new(Mutex::new(Vec::new()));
|
let queue_spawn = Rc::new(Mutex::new(Vec::new()));
|
||||||
let queue_defer = Rc::new(Mutex::new(Vec::new()));
|
let queue_defer = Rc::new(Mutex::new(Vec::new()));
|
||||||
let (tx, rx) = channel::unbounded();
|
let (tx, rx) = unbounded();
|
||||||
|
|
||||||
// HACK: Extract mlua "pending" constant value and store it
|
// HACK: Extract mlua "pending" constant value and store it
|
||||||
let pending = lua
|
let pending = lua
|
||||||
.create_async_function(|_, ()| async move {
|
.create_async_function(|_, ()| async move {
|
||||||
yield_now().await;
|
smol::future::yield_now().await;
|
||||||
Ok(())
|
Ok(())
|
||||||
})?
|
})?
|
||||||
.into_lua_thread(lua)?
|
.into_lua_thread(lua)?
|
||||||
|
|
Loading…
Add table
Reference in a new issue