std.dispatch.queue
create-dispatch
added in 3.0
(create-dispatch {:keys [options], :as m})creates a queue executor
;; DELAY, MAX-BATCH 300 (test-scaffold +test-config+) => (contains 300)
;; DELAY, MAX-BATCH 500 (test-scaffold (-> +test-config+ (assoc-in :options :queue :max-batch 500))) => (contains 500)
;; NO DELAY, MAX-BATCH 300 (test-scaffold (-> +test-config+ (update-in :options :queue dissoc :delay))) ;; 29 300 300 300 71 => #(-> % count (>= 4))
;; NO DELAY, MAX-BATCH 500 (test-scaffold (-> +test-config+ (update-in :options :queue dissoc :delay) (assoc-in :options :queue :max-batch 500))) ;; 43 500 457 => #(-> % count (<= 3))
handler-fn
added in 3.0
(handler-fn {:keys [handler runtime options], :as dispatch})creates a queue handler function
start-dispatch
added in 3.0
(start-dispatch {:keys [runtime], :as dispatch})starts a queue executor
(-> (create-dispatch +test-config+) (start-dispatch) (h/stop))
submit-dispatch
added in 3.0
(submit-dispatch {:keys [handler runtime options], :as dispatch} entry)submits to a queue executor