diff --git a/CHANGES.org b/CHANGES.org index 1502735..2de897c 100644 --- a/CHANGES.org +++ b/CHANGES.org @@ -1,6 +1,12 @@ * Changes ** 0.3.3 Changes: +- #43: Passing thread-bindings through to scheduled task +- #41: Allow user to override the thread-factory used by Chime, makes Chime Loom-friendly (thanks @jimpil) +- Allow specifying 'clock' to `chime-at` (thanks @jimpil) +- #36: ensure we only call on-finished once (thanks @dazld) +- #33: include thread-count in thread name (thanks @orestis and @pmonks) +- #34: add `IPending` implementation to return value of `chime-at` (thanks @nukep) - The without-past-times didn't work with joda dates, even with chime.joda-date imported. ** 0.3.2 diff --git a/README.adoc b/README.adoc index 79e339c..68c9008 100644 --- a/README.adoc +++ b/README.adoc @@ -8,12 +8,12 @@ Add the following to your `project.clj`/`deps.edn` file: [source,clojure] ---- -[jarohen/chime "0.3.2"] +[jarohen/chime "0.3.3"] ---- [source,clojure] ---- -{jarohen/chime {:mvn/version "0.3.2"}} +{jarohen/chime {:mvn/version "0.3.3"}} ---- == The ‘Big Idea’™ behind Chime @@ -94,6 +94,15 @@ To generate the sequence of times, you'll need to seed the call to `periodic-seq (Period/ofDays 1)) ---- +For example, to say hello once per second: +[source,clojure] +---- +(chime/chime-at (chime/periodic-seq (Instant/now) (Duration/ofSeconds 1)) + ;; note that the function needs to take an argument. + (fn [time] + (println "hello"))) +---- + === Complex schedules Because there is no scheduling DSL included with Chime, the sorts of schedules that you can achieve are not limited to the scope of the DSL. diff --git a/project.clj b/project.clj index a2553a1..b781da8 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject jarohen/chime "0.3.3" +(defproject jarohen/chime "0.3.4-SNAPSHOT" :description "A really lightweight Clojure scheduler" :url "https://github.com/jarohen/chime" @@ -6,7 +6,7 @@ :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} - :dependencies [[org.clojure/clojure "1.10.1"] - [org.clojure/tools.logging "1.0.0"] + :dependencies [[org.clojure/clojure "1.10.3"] + [org.clojure/tools.logging "1.2.3"] [clj-time/clj-time "0.15.2" :scope "provided"] - [org.clojure/core.async "1.1.587" :scope "provided"]]) + [org.clojure/core.async "1.5.648" :scope "provided"]]) diff --git a/src/chime.clj b/src/chime.clj index 0168afc..fa52250 100644 --- a/src/chime.clj +++ b/src/chime.clj @@ -20,7 +20,7 @@ Usage: - (let [chimes (chime-ch [(.plusSeconds (Instant/now) -2) ; has already passed, will be ignored. + (let [chimes (chime-ch [(.plusSeconds (Instant/now) -2) (.plusSeconds (Instant/now) 2) (.plusSeconds (Instant/now) 2)])] (a/