-
Notifications
You must be signed in to change notification settings - Fork 11
Priority Queues
akshat edited this page Jul 28, 2022
·
6 revisions
Jobs differ from one-another in terms of:
- Rate of ingestion
- Time of execution
- Failure rates
To handle different types of jobs, Goose allows configuration of custom queues. By default, all jobs go to default
queue. To change this, use :queue
option.
Note: Custom queue name cannot be
scheduled-jobs
ordead-jobs
as Goose uses them internally.
(ns my-ns
(:require [goose.client :as c]
[goose.worker :as w]))
(def high-priority-opts (assoc c/default-opts :queue "high"))
(c/perform-async high-priority-opts `high-priority-fn :foo)
(def low-priority-opts (assoc c/default-opts :queue "low"))
(c/perform-async low-priority-opts `low-priority-fn :foo)
(w/start (assoc w/default-opts
:queue "high" :threads 10))
(w/start (assoc w/default-opts
:queue "low" :threads 2))
Home | Getting Started | RabbitMQ | Redis | Error Handling | Monitoring | Production Readiness | Troubleshooting
Need help? Open an issue or ping us on #goose @Clojurians slack.