clj-rq

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 is designed to have a low barrier to entry.

Features

  • Simple: Easy to use with a clean API
  • Redis-backed: Leverages Redis for reliable queue management
  • Background Processing: Process jobs asynchronously with workers
  • Clojure Native: Built specifically for Clojure applications
  • Low Overhead: Minimal impact on your application’s performance

Installation

Add the dependency to your project:

1
2
3
4
5
6
;; deps.edn
{:deps
 {com.moclojer/clj-rq {:mvn/version "0.2.0"}}}

;; Leiningen/Boot
[com.moclojer/clj-rq "0.2.0"]

Usage Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
(ns my-app.core
  (:require [com.moclojer.clj-rq.core :as rq]))

;; Define a job function
(defn process-data [data]
  (println "Processing:" data))

;; Enqueue a job
(rq/enqueue :default process-data {:user-id 123})

;; Start a worker
(rq/start-worker :default)

View on GitHub