std.dispatch.board

+counter+

add-dependents

added in 3.0

(add-dependents m group dependents)

add dependents to a given lookup

(add-dependents {:a #{:d}} :a #{:b :c}) => {:a #{:c :b :d}}

clear-board

added in 3.0

(clear-board {:keys [runtime], :as dispatch} group ticket)

clears the board

(def -ex- (doto (-> (create-dispatch +test-config+)) (submit-board {:id “a”} “t0”) (poll-board “a”)))

(clear-board -ex- “a” “t0”) => {:group “a”, :dependent #{“a”}}

create-dispatch

added in 3.0

(create-dispatch {:keys [hooks options], :as m})

creates the board executor

create-dispatch-typecheck

get-ticket

added in 3.0

(get-ticket)

gets a ticket

new-board

added in 3.0

(new-board {:keys [limit]})

creates a new board

(new-board {})

poll-board

added in 3.0

(poll-board {:keys [runtime options], :as dispatch} group)

polls the board for job entry

(def -ex- (doto (create-dispatch +test-config+) (submit-board {:id “a”} “t0”)))

(poll-board -ex- “a”) => (contains {:groups “a”, :entry {:id “a”}, :ticket “t0”})

poll-dispatch

added in 3.0

(poll-dispatch {:keys [handler runtime], :as dispatch} groups)

polls the executor for more work

start-dispatch

added in 3.0

(start-dispatch dispatch)

starts the board executor

(test-scaffold +scaffold-config+ [:a :b :c :a :b :c :b :d :b :c :d :c :a :b :c :c :d :a]) => (contains [{:id 0, :groups :a :b :c} {:id 2, :groups :c} {:id 1, :groups :a :b} {:id 3, :groups :b :d} {:id 6, :groups :a} {:id 10, :groups :a} {:id 4, :groups :b :c :d} {:id 5, :groups :c} {:id 9, :groups :d} {:id 7, :groups :b :c} {:id 8, :groups :c}] :in-any-order)

stop-dispatch

added in 3.0

(stop-dispatch dispatch)

stops the board executor

submit-board

added in 3.0

(submit-board dispatch entry)(submit-board {:keys [runtime options], :as dispatch} entry ticket)

submits an entry to a board

(def -ex- (create-dispatch +test-config+))

(-> -ex- (submit-board {:id “a”} “t0”)) => (contains [“t0” “a” h/future?])

submit-dispatch

added in 3.0

(submit-dispatch dispatch entry)

submits to the board executor

submit-ticket

added in 3.0

(submit-ticket m groups ticket)

adds ticket to the board

(submit-ticket {} “a” “b” “t1”) => {“a” “t1”, “b” “t1”}