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

Using offer! with a buffered channel returns false #147

Open
julienvincent opened this issue Nov 23, 2023 · 0 comments
Open

Using offer! with a buffered channel returns false #147

julienvincent opened this issue Nov 23, 2023 · 0 comments

Comments

@julienvincent
Copy link

I am trying to build a queuing system that puts values onto a buffered chan using offer! under the expectation that offer! should return true if there is still space in the channels buffer.

It seems that the current implementation only returns true if there is a pending take[!].

This behaviour seems rather unexpected to me and perhaps even a bug. It also differs from the bahaviour of core.async offer! which will return true if the value can be put into the channels buffer.

Is this intensional? If not is it possible to rework offer! to return true if the value can be placed into the buffered chan regardless of a pending take[!]?

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

No branches or pull requests

1 participant