I have seen in forum we discuss about books etc on functional pattern etc.
I wanted to init a thread where we could discuss code snippets/review them and propose maybe other way to do in a functional mode, or maybe learn new functional pattern in clojure, which we didn’t know.
So let me try first
In a recent side project i have written something like this
On the high-level i’m using quarzite library.
The 1st function schedule the jobs and i use the 2nd with map and doall.
;; ...
;; create rocket-chat msg job with only 1 trigger
;; it can be same for all. ( maybe later extend this.)
(defn schedule-job-and-trigger [jobs-map]
(let [s (-> (qs/initialize) qs/start)
job (create-rocket-msg-job jobs-map)
trigger (create-rocket-msg-trigger)]
(qs/schedule s job trigger)))
(defn schedule-all-jobs-and-triggers [jobs]
(doall (map schedule-job-and-trigger jobs) ))
Is there any better alternative way for doing this? i’m missing something ?