Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix thread function of sync coroutines #4

Open
wants to merge 2 commits into
base: neo
Choose a base branch
from

Conversation

tapayne88
Copy link

Sorry if I've got this completely wrong!

I don't think the expected printed values of the sync coroutines function thread match up.

lua-async-await/README.md

Lines 118 to 123 in a54c078

local thread = co.create(function ()
local x = co.yield(1)
print(x)
local y, z = co.yield(2, 3)
print(y)
end)

We can expect to see `1`, `2 3` printed.

@tapayne88
Copy link
Author

Found this too, pong expects a function to be passed and creates a thread itself

lua-async-await/README.md

Lines 217 to 224 in a54c078

local thread = co.create(function ()
local x, y, z = co.yield(echo(1, 2, 3))
print(x, y, z)
local k, f, c = co.yield(echo(4, 5, 6))
print(k, f, c)
end)
pong(thread)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant