From b2ce00b70dfbda9714556914c0b71c449b4c0b3d Mon Sep 17 00:00:00 2001 From: Filip Tibell Date: Sat, 20 Jan 2024 11:34:10 +0100 Subject: [PATCH] Clarify comment in run_async --- lib/runtime.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/runtime.rs b/lib/runtime.rs index 667d7b6..54845e8 100644 --- a/lib/runtime.rs +++ b/lib/runtime.rs @@ -163,12 +163,12 @@ impl<'lua> Runtime<'lua> { used to create this runtime, otherwise this method may panic. */ 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 main_exec = Arc::new(Executor::new()); - // TODO: Create multiple executors for work stealing - // Store the main executor in lua for LuaExecutorExt trait self.lua.set_app_data(Arc::downgrade(&main_exec));