(add-to-batch engine it)
Adds item to batch, adds batch to queue if max-items was reached.
Adds item to batch, adds batch to queue if max-items was reached.
(force-enqueue engine)
Forces a batch to queue if queue is empty and the runner state allows for more tasks
Forces a batch to queue if queue is empty and the runner state allows for more tasks
(mark-invalid-state s)
If state is invalid, mark it with an exception
If state is invalid, mark it with an exception
(merge-ps result paging-state)
Updates an existing pagestate map with results. It will specially handle :pages, :items, :page-cursor, the rest of it is merged into paging-state as is.
Updates an existing pagestate map with results. It will specially handle :pages, :items, :page-cursor, the rest of it is merged into paging-state as is.
(paging-state? s)
Returns true if the map looks like a paging state with cursor.
Returns true if the map looks like a paging state with cursor.
(run-from-queue! {:keys [runner-fn ch-result] :as engine})
Enqueues a batch with the runner if there is one in the queue and the runner has capacity. Returns new engine state.
Enqueues a batch with the runner if there is one in the queue and the runner has capacity. Returns new engine state.
(swap-xf! atom* f)
A transducer that runs f on atom* for each item seen.
A transducer that runs f on atom* for each item seen.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close