Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Producer Consumer Queue in Clojure

Tags:

clojure

I want to build a producer-consumer program in clojure. The requirement is the consumer can drag items from the queue while the producer is putting messages into the queue, if using java I will use ConcurrentLinkedQueue, but I'm not very sure how to do it in clojure using the immutable collections, please help.

like image 560
James.Xu Avatar asked Mar 22 '26 02:03

James.Xu


1 Answers

If you just want 1 consumer, just use an agent. If not see see Clojure Producer Consumer or Producer consumer with qualifications

like image 78
DanLebrero Avatar answered Mar 24 '26 23:03

DanLebrero



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!