Easily publish and receive messages containing any type of nested data structure to dynamically-created queues and topics.
Easily publish and receive messages containing any type of nested data structure to dynamically-created queues and topics.
Utilities specific to HornetQ
Utilities specific to [HornetQ](http://hornetq.jboss.org/)
Provides functions for creating and managing pipelines. A pipeline is a composition of functions ("steps"), where each function is passed the result of the previous function, dereferenced if needed. It is built on top of Immutant's messaging subsystem, allowing each step to have multiple processing threads, and to be automatically load balanced across a cluster.
The pipeline
function takes a unique (within the scope of the
application) name, one or more single-arity functions, and optional
kwarg options, returning a function that places its argument onto
the pipeline when called. The resulting pipeline-fn optionally
returns a delay that can be used to retrieve the result of the
pipeline execution.
Each function can be optionally be wrapped with metadata that provides options for how that particular function is handled (see the 'step' fn below).
Example:
(require '[immutant.pipeline :as pl])
(defn calculate-foo [m]
...
(assoc m :foo value))
(defn save-data [m]
...)
;; create a pipeline
(defonce foo-pipeline
(pl/pipeline "foo" ;; pipelines must be named
(pl/step calculate-foo :concurrency 5) ;; run this step with 5 threads
(pl/step #(update-in % [:bar] + (:foo %)) :name :update-bar) ;; give this step a name
save-data ;; a 'vanilla' step
:concurrency 2 ;; run all steps with 2 threads (unless overridden)
:error-handler (fn [ex m] ;; do something special with errors, and retry
...
(pl/retry (update-in m [:retry-count] (fnil inc 0))))))
;; put data onto the front pipeline
(foo-pipeline {:bar 1 :ham "biscuit"})
;; put data onto the pipeline at a given step
(foo-pipeline {:bar 1 :foo 42 :ham "gravy"} :step :update-bar)
;; get the result
(deref (foo-pipeline {:bar 1 :ham "biscuit"}) 1000 ::timeout!)
;; optional - it will automatically be stopped on undeploy
(pl/stop foo-pipeline)
Provides functions for creating and managing pipelines. A pipeline is a composition of functions ("steps"), where each function is passed the result of the previous function, dereferenced if needed. It is built on top of Immutant's messaging subsystem, allowing each step to have multiple processing threads, and to be automatically load balanced across a cluster. The [[pipeline]] function takes a unique (within the scope of the application) name, one or more single-arity functions, and optional kwarg options, returning a function that places its argument onto the pipeline when called. The resulting pipeline-fn optionally returns a delay that can be used to retrieve the result of the pipeline execution. Each function can be optionally be wrapped with metadata that provides options for how that particular function is handled (see the 'step' fn below). Example: ``` (require '[immutant.pipeline :as pl]) (defn calculate-foo [m] ... (assoc m :foo value)) (defn save-data [m] ...) ;; create a pipeline (defonce foo-pipeline (pl/pipeline "foo" ;; pipelines must be named (pl/step calculate-foo :concurrency 5) ;; run this step with 5 threads (pl/step #(update-in % [:bar] + (:foo %)) :name :update-bar) ;; give this step a name save-data ;; a 'vanilla' step :concurrency 2 ;; run all steps with 2 threads (unless overridden) :error-handler (fn [ex m] ;; do something special with errors, and retry ... (pl/retry (update-in m [:retry-count] (fnil inc 0)))))) ;; put data onto the front pipeline (foo-pipeline {:bar 1 :ham "biscuit"}) ;; put data onto the pipeline at a given step (foo-pipeline {:bar 1 :foo 42 :ham "gravy"} :step :update-bar) ;; get the result (deref (foo-pipeline {:bar 1 :ham "biscuit"}) 1000 ::timeout!) ;; optional - it will automatically be stopped on undeploy (pl/stop foo-pipeline) ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close