Closed Bilal2453 closed 3 years ago
Issue:
If you try the following code
require'coro-split'( function() print(1) print(2) end, function() print(3) print(4) end, function() print(5) print(6) end )
it would error with the said error message after it executed everything successfully
cannot resume running coroutine
Explanation:
That's due to all tasks being spawned and completed before coroutine.yield have been reached, therefor the coroutine.resume in check would fail.
coroutine.yield
coroutine.resume
check
Solution: Basically make sure you only resume if yield have been executed (or tagged as so), otherwise return without yielding.
Love it, thanks!
Issue:
If you try the following code
it would error with the said error message after it executed everything successfully
Explanation:
That's due to all tasks being spawned and completed before
coroutine.yield
have been reached, therefor thecoroutine.resume
incheck
would fail.Solution: Basically make sure you only resume if yield have been executed (or tagged as so), otherwise return without yielding.