To start message queue You should do following steps:
config
:(require '[datomic.api :as d])
(def conn (d/connect "your-datomic-db-uri"))
(def config
{:conn conn
:q d/q
:db d/db
:transact d/transact-async
:tiny-queue-processors {}})
tiny-queue
schema:(tq/create-schema config)
:db/ident
, second argument is a doc string):(tq/define-new-job config :qcommand/first-job "My first job!")
(defn first-job-processor [[snapshot job uuid]]
(println "Processing first job" uuid)
[])
tiny-queue-processors
:(def tiny-queue-processors {:qcommand/first-job first-job-processor})
wrap-background-job
:(require '[tiny-queue.core :as tq])
(def final-config (assoc config :tiny-queue-processors tiny-queue-processors))
(def background-processor (atom nil))
(reset! background-processor (future (wrap-background-job final-config 0)))
(tq/create-new-job final-config {:command :qcommand/first-job
:data "first-job-data"})
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close