Hi guys,
I have an app that sometimes needs to put a lot of messages on a channel. The rate is not directly under my control - the messages come from the outside.
As a quick test, I wrote this snippet
(def c (chan (async/buffer 10240)))
(go
(doseq [i (range 1024000)]
(>!! c i)))
and i hit this exception:
Exception in thread "async-dispatch-14" java.lang.AssertionError: Assert failed: No more than 1024 pending puts are allowed on a single channel. Consider using a windowed buffer.
(< (.size puts) impl/MAX-QUEUE-SIZE)
If I replace the buffer with a dropping buffer or a sliding buffer, it works but I can't afford to drop messages. However, I'd be fine with a larger buffer than 1024.
I also replaced the >!! with >! and async/put!, but the result is the same.
Is there a way to achieve my goal?
Thanks,
--h