Skip to content

Fix thread function of sync coroutines#4

Open
tapayne88 wants to merge 2 commits into
ms-jpq:neofrom
tapayne88:fix/pong-sync-coroutines
Open

Fix thread function of sync coroutines#4
tapayne88 wants to merge 2 commits into
ms-jpq:neofrom
tapayne88:fix/pong-sync-coroutines

Conversation

@tapayne88

Copy link
Copy Markdown

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
Copy Markdown
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