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

Channels and Class instance state: loop-earliest-more syntax results in shared state #223

Closed
nxadm opened this issue Dec 4, 2015 · 2 comments
Labels
docs Documentation issue (primary issue type)

Comments

@nxadm
Copy link
Contributor

nxadm commented Dec 4, 2015

According to http://doc.perl6.org/language/concurrency#Channels, "[b]ecause looping over a channel in this manner [with $channel.poll and $channel.closed] is a common pattern there is a simpler functional syntax to do this", namely the "loop-earliest-more" syntax. The wording make it sound as both syntaxes should be equivalent.

However, the "loop-earliest-more" syntax results in an unwanted shared state between Class instances, while the classic syntax does not exhibit this problem.

See short runnable and commented code examples: https://gist.github.com/nxadm/6d867ad7410330d1bfac

This bug is reported here to know if this different behaviour should be documented (a feature ;) ) or just a bug.

Thank you,

C.

@jonathanstowe
Copy link
Contributor

It looks like there is a problem with closure on one of those blocks on the earliest, it looks like earliest is going to be removed at some point so I'll remove the earliest bit from the doc and do a better example using react

@nxadm
Copy link
Contributor Author

nxadm commented Dec 8, 2015

Doc seems to gave been updated.

@nxadm nxadm closed this as completed Dec 8, 2015
@AlexDaniel AlexDaniel added the docs Documentation issue (primary issue type) label Jun 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation issue (primary issue type)
Projects
None yet
Development

No branches or pull requests

3 participants