jxa/resque-clojure — Issue #2: Trying to get resque-clojure to run as its own process
Author: newfoundresearch
Created: 2011-12-08 19:47:47+00:00
State: open

I am trying to get resque-clojure to run as its own process and am having some trouble. For example:

(ns my-project.resque-agent
(:require [resque-clojure.core :as resque]))

(resque/configure {:host (or (System/getenv "REDIS_HOST") "localhost")
:port (or (System/getenv "REDIS_PORT") 6379)
:poll-interval 1000
:max-workers 10})

(defn -main []
(resque/start ["workqueue"]))

Then I try to run it with:

> lein run -m my-project.resque-agent

To which I get:

IllegalArgumentException No matching ctor found for class redis.clients.jedis.JedisPool clojure.lang.Reflector.invokeConstructor (Reflector.java:186)

The trouble seems to be in calling resque/start from within another function; I get the same error on the repl whenever I wrap resque/start in a function.

What I am trying to achieve is the ability to launch multiple workers, powered by lein, using the same code. What am I doing wrong?

Thanks!