Closed dspearson closed 3 years ago
I think expecting timed-out takes to cease being counted as "pending" is reasonable. I checked with the core.async code base, and they periodically clean out pending takes and puts.
I wrote a fix for the takes, but I realized I still need to double-check the puts as well. They're probably affected by the same issue. Should have something shortly, anyway.
Hey @dspearson, check out #195 when you get a chance, and let me know if it fixes your issue.
Sorry for the delay. That does indeed appear to solve the issue, thank you! Tested with (dotimes [n 300000] (try-take! y 1))
, where y is a stream. It no longer throws an exception.
When attempting to fetch from a stream, and expecting it to fail with a timeout with try-take!, :pending-takes is still incremented and results in an exception with excessive pending takes. Maybe I am using it incorrectly, but I would expect that timed-out takes would result in no mutated state of the stream since they would no longer be relevant.