RQ (Redis Queue) is a simple Clojure package for queueing jobs and processing them in the background with workers. It is backed by Redis and it is designed to have a low barrier to entry
I noticed that our API is inconsistent and hard to understand.
Functions are named as nouns and do not indicate state changes.
(defn producer
"Push a job to the queue"
I feel like this gets the end user confused while trying to understand that this is a function, and not a var.
(defn push!
Would be better.
queue != pubsub
This is a problem that I saw in Carmine, which even affected us. I like the idea of having a producer/consumer that repeats what pub/sub does, but it would be nice to focus more on the wrapper part (push-r, push-l, etc.) and leave the issue of sending/receiving messages outside of it, but still support it for the queue.
For example, this function
(defn consumer-size
"get size of the queue"
[redis-client queue-name]
(.llen @redis-client (pattern-name queue-name)))
is part of queue.clj, but since it is named as consumer (thus part of the producer/consumer implementation that mimics pub/sub using queues), it confuses the user, even though the final operation (.llen) is specifically a queue operation.
I noticed that our API is inconsistent and hard to understand.
I feel like this gets the end user confused while trying to understand that this is a function, and not a var.
Would be better.
This is a problem that I saw in Carmine, which even affected us. I like the idea of having a producer/consumer that repeats what pub/sub does, but it would be nice to focus more on the wrapper part (push-r, push-l, etc.) and leave the issue of sending/receiving messages outside of it, but still support it for the queue.
For example, this function
is part of queue.clj, but since it is named as consumer (thus part of the producer/consumer implementation that mimics pub/sub using queues), it confuses the user, even though the final operation (.llen) is specifically a queue operation.
What I have in mind:
na queue teria mais, ja que eh um wrapper do jedis de qualquer forma