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

Make channels iteration easier #116

Open
IUdalov opened this issue Oct 29, 2018 · 1 comment
Open

Make channels iteration easier #116

IUdalov opened this issue Oct 29, 2018 · 1 comment
Milestone

Comments

@IUdalov
Copy link
Contributor

IUdalov commented Oct 29, 2018

It would be nice if I can write code like this:

local channel = effil.channel()
-- fill channel
for value in channel:iterate() do
    print(value)
end
@IUdalov IUdalov added this to the backlog milestone Oct 29, 2018
@mihacooper
Copy link
Member

It can be implemented like that:

chan = require("effil").channel()
chan:push(1)
chan:push(2)
chan:push(3)

for k in function() return chan:pop(0) end do
    print(k)
end

Do we really need it in out API?

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

No branches or pull requests

2 participants