Skip to content

Commit

Permalink
Update to Immutant 2.1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias committed Sep 1, 2015
1 parent fab31f3 commit 81a48d1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion doc/overview.org
Expand Up @@ -37,7 +37,7 @@
** immutant.scheduling

- schedules specified by maps created with helper functions
- singleton by default (runs on only one node in cluster)
- non-singleton by default (runs on every one node in cluster)
- not durable

examples: [[../src/demo/scheduling.clj][demo/scheduling.clj]]
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Expand Up @@ -4,7 +4,7 @@
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]
[org.immutant/immutant "2.0.2"]
[org.immutant/immutant "2.1.0"]
[compojure "1.3.4"]
[ring/ring-devel "1.3.1"]
[org.clojure/core.memoize "0.5.6"]
Expand Down
7 changes: 3 additions & 4 deletions src/demo/scheduling.clj
@@ -1,5 +1,5 @@
(ns demo.scheduling
(:require [immutant.scheduling :refer (every at in until limit cron) :as sch]
(:require [immutant.scheduling :refer (every at in until limit cron singleton) :as sch]
[immutant.util :as util]
immutant.scheduling.joda
clj-time.core
Expand Down Expand Up @@ -80,9 +80,8 @@

;; singleton jobs require an id
(sch/schedule #(println "I run on ONE node")
(-> {:id :a-unique-id-for-the-singleton}
(-> (singleton :a-unique-id-for-the-singleton)
(every 10 :seconds)))

(sch/schedule #(println "I run on EVERY node")
(-> {:singleton false}
(every 9 :seconds)))))
(every 9 :seconds))))

0 comments on commit 81a48d1

Please sign in to comment.