mirror of
https://github.com/lune-org/mlua-luau-scheduler.git
synced 2025-04-10 21:40:55 +01:00
Clarify comment in run_async
This commit is contained in:
parent
c00c07cf24
commit
b2ce00b70d
1 changed files with 3 additions and 3 deletions
|
@ -163,12 +163,12 @@ impl<'lua> Runtime<'lua> {
|
||||||
used to create this runtime, otherwise this method may panic.
|
used to create this runtime, otherwise this method may panic.
|
||||||
*/
|
*/
|
||||||
pub async fn run_async(&self) {
|
pub async fn run_async(&self) {
|
||||||
// Create new executors to use
|
// Create new executors to use - note that we do not need to create multiple executors
|
||||||
|
// for work stealing, using the `spawn` global function that smol provides will work
|
||||||
|
// just fine, as long as anything spawned by it is awaited from lua async functions
|
||||||
let lua_exec = LocalExecutor::new();
|
let lua_exec = LocalExecutor::new();
|
||||||
let main_exec = Arc::new(Executor::new());
|
let main_exec = Arc::new(Executor::new());
|
||||||
|
|
||||||
// TODO: Create multiple executors for work stealing
|
|
||||||
|
|
||||||
// Store the main executor in lua for LuaExecutorExt trait
|
// Store the main executor in lua for LuaExecutorExt trait
|
||||||
self.lua.set_app_data(Arc::downgrade(&main_exec));
|
self.lua.set_app_data(Arc::downgrade(&main_exec));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue