mirror of
https://github.com/mlua-rs/mlua
synced 2026-06-08 16:05:43 +00:00
Change AsyncThread<A, R> to AsyncThread<R>.
Push arguments in `Thread::into_async()` to the thread during the call instead of first poll. The pushed arguments will be automatically used on resume. Fixes #508 and relates to #500.
This commit is contained in:
+3
-3
@@ -161,10 +161,10 @@ impl Function {
|
||||
{
|
||||
let lua = self.0.lua.lock();
|
||||
let thread_res = unsafe {
|
||||
lua.create_recycled_thread(self).map(|th| {
|
||||
let mut th = th.into_async(args);
|
||||
lua.create_recycled_thread(self).and_then(|th| {
|
||||
let mut th = th.into_async(args)?;
|
||||
th.set_recyclable(true);
|
||||
th
|
||||
Ok(th)
|
||||
})
|
||||
};
|
||||
async move { thread_res?.await }
|
||||
|
||||
Reference in New Issue
Block a user