Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Chris Zheng
committed
Mar 7, 2016
1 parent
910751e
commit 0c570c2
Showing
5 changed files
with
83 additions
and
40 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
(defproject im.chit/hara.time.joda "2.2.16" | ||
(defproject im.chit/hara.time.joda "2.2.17" | ||
:description "joda time extensions for hara.time" | ||
:url "https://www.github.com/zcaudate/hara.time.joda" | ||
:license {:name "The MIT License" | ||
:url "http://http://opensource.org/licenses/MIT"} | ||
:dependencies [[org.clojure/clojure "1.7.0"] | ||
[joda-time "2.9.2"]] | ||
:profiles {:dev {:dependencies [[midje "1.6.3"] | ||
[im.chit/hara.time "2.2.16"]] | ||
[im.chit/hara.time "2.2.17"] | ||
[im.chit/hara.io.scheduler "2.2.17"]] | ||
:plugins [[lein-midje "3.1.3"]]}}) |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
(ns hara.time.scheduler-test | ||
(:use midje.sweet) | ||
(:require [hara.time :as t] | ||
[hara.time.joda] | ||
[hara.io.scheduler :as scheduler] | ||
[hara.concurrent.ova :as ova])) | ||
|
||
(def sch2 | ||
(scheduler/scheduler {:l1 (fn [t params] (println t params)) | ||
:l2 (fn [t params] (println t params))} | ||
{:l1 {:schedule "* * * * * * *" | ||
:params {:data "foo"}} | ||
:l2 {:schedule "/2 * * * * * *" | ||
:params {:data "bar"}}} | ||
{:clock {:type org.joda.time.DateTime | ||
:timezone "GMT"}})) | ||
|
||
(comment (scheduler/start! sch2) | ||
|
||
|
||
(scheduler/add-task sch2 :hello {:handler (fn [t params] (println params)) | ||
:schedule "* * * * * * *" | ||
:params {:data "foo"}}) | ||
|
||
(scheduler/delete-task sch2 :hello) | ||
|
||
(scheduler/empty-tasks sch2) | ||
|
||
(scheduler/stop! sch2)) | ||
|