         (println "unscheduling beep & boop")
         (sch/stop beep)
         (sch/stop boop))
-      (sch/in 20 :seconds)))
+      (in 20 :seconds)))
 
   ;; start singleton and non-singleton jobs to demo cluster failover
   (when (util/in-container?)
 
     ;; singleton jobs require an id
     (sch/schedule #(println "I run on ONE node")
-      (-> (sch/every 10 :seconds)
-        (sch/id :a_singleton)))
+      (-> {:id :a-unique-id-for-the-singleton}
+        (every 10 :seconds)))
 
     (sch/schedule #(println "I run on EVERY node")
-      (-> (sch/every 9 :seconds)
-        (sch/singleton false)))))
+      (-> {:singleton false}
+        (every 9 :seconds)))))

(ns demo.scheduling
  (:require [immutant.scheduling :as sch]
            [immutant.util       :as util]
            immutant.scheduling.joda
            clj-time.core

;; scheduling specs are just maps. we provide optional helpers for
;; generating thoes maps
(def every-5s
  (or
    {:every (or 5000 [5 :seconds])}
    (every 5 :seconds)))

;; :at can be a Date, a time as a string, or millis since epoch
(def daily
  (-> (at (or (Date.) "1830" 1395439646983))
    (every :day)))

;; helpers optionally take a map as the first arg, so compose
(def in-5m-until-5pm
  (-> (in 5 :minutes)
    (every 2 :hours, 30 :minutes)
    (until "1700")))

;; cron-style strings are also supported
(def nine-am
  (cron "0 0 9 * * ?"))

(def every-5s-cron
  (cron "*/5 * * * * ?"))

(def every-10ms-in-500ms-4-times
  (-> (in 500)
    (every 10)
    (limit 4)))

;; you can use clj-time periods if using clj-time
(defn every-3s-lazy-seq []
