Created
December 26, 2014 15:34
-
-
Save AlBaker/fd1d89e3d9bd57328abe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns testjobs | |
(:require [clojurewerkz.quartzite.scheduler :as qs] | |
[clojurewerkz.quartzite.jobs :as j] | |
[clojurewerkz.quartzite.triggers :as t] | |
[clojurewerkz.quartzite.conversion :as qc] | |
[clojurewerkz.quartzite.schedule.simple :refer [schedule with-repeat-count with-interval-in-milliseconds]])) | |
(j/defjob TestJob | |
[ctx] | |
(let [d (qc/from-job-data ctx)] | |
(println (str "Here's my payload:" d) ))) | |
(defn run-job [] | |
(qs/initialize) | |
(qs/start) | |
(let [job (j/build | |
(j/of-type TestJob) | |
(j/using-job-data {"jack" "in the box"}) | |
(j/with-identity (j/key "bananas"))) | |
tk (t/key "triggers.2") | |
trigger (t/build | |
(t/with-identity tk) | |
(t/start-now) | |
(t/with-schedule (schedule | |
(with-repeat-count 100) | |
(with-interval-in-milliseconds 2000))))] | |
(qs/schedule job trigger) | |
tk)) |
I had a look at the code. The problem is that t/build
is a threading form, but the implicit parameter is hidden by the macro; see here. This will be tricky to support unfortunately, since the parameter doesn't appear anywhere in the source code. I can't think of a good workaround except disabling the arity inspection, sorry. Ideally it would be possible to disable it by form, but that is not done yet.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok, so it looks like
t/build
is some sort of threading form, is that right?