You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.asyncoffer! 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[!]?
The text was updated successfully, but these errors were encountered:
I am trying to build a queuing system that puts values onto a buffered
chan
usingoffer!
under the expectation thatoffer!
should returntrue
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 returntrue
if the value can be put into the channels buffer.Is this intensional? If not is it possible to rework
offer!
to returntrue
if the value can be placed into the buffered chan regardless of a pendingtake[!]
?The text was updated successfully, but these errors were encountered: