refactor: use new async code for runner and simplify task class

This commit is contained in:
Folke Lemaitre 2024-06-26 17:06:56 +02:00
parent 768de1ebf6
commit 765773a176
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
5 changed files with 133 additions and 205 deletions

View file

@ -30,12 +30,11 @@ describe("runner", function()
end,
}
package.loaded["lazy.manage.task.test"]["async" .. i] = {
---@async
---@param task LazyTask
run = function(task)
task:async(function()
coroutine.yield()
table.insert(runs, { plugin = task.plugin.name, task = task.name })
end)
coroutine.yield()
table.insert(runs, { plugin = task.plugin.name, task = task.name })
end,
}
end