I'm trying to implement a carmine worker in a constantly running process.
When launching the following app with lein run myclass.foo
, it just starts the worker and stops it right away.
(def my-worker
(car-mq/worker queue-server "my-queue"
{:handler (fn [{:keys [message attempt]}]
(println "Received" message)
{:status :success})
:auto-start false}))
(defn -main []
(car-mq/start my-worker))
My goal is something like that
- Launch the foo listener
- foo listener runs in foreground and prints everything that gets posted to the queue
- Ctrl-c / quit will close the listener