Skip to content

Commit

Permalink
fixup! add single transaction support for long range transduce
Browse files Browse the repository at this point in the history
  • Loading branch information
cnautze committed Jan 9, 2025
1 parent fbd857b commit fe5bb1e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/exoscale/vinyl/store.clj
Original file line number Diff line number Diff line change
Expand Up @@ -595,17 +595,17 @@
([db xform f val continuing-fn transduce-fn]
(continuation-traversing-transduce db xform f val nil continuing-fn transduce-fn))
([db xform f val transaction-fn continuing-fn transduce-fn]
(let [cont (atom nil)
result (atom val)
runner (wrapped-runner db runner-params)]
(-> (run-async
runner
(fn [^FDBRecordStore store]
(when (some? transaction-fn)
(transaction-fn (wrapped-record-store store)))
(-> (continuing-fn store @cont)
(transduce-fn xform f result #(reset! cont %)))))
(fn/close-on-complete runner)))))
(let [cont (atom nil)
result (atom val)
runner (wrapped-runner db runner-params)]
(-> (run-async
runner
(fn [^FDBRecordStore store]
(when (some? transaction-fn)
(transaction-fn (wrapped-record-store store)))
(-> (continuing-fn store @cont)
(transduce-fn xform f result #(reset! cont %)))))
(fn/close-on-complete runner)))))

(defn- get-range-fn [^TupleRange tuple-range {::keys [limit]}]
(fn [^FDBRecordStore store ^bytes cont]
Expand Down

0 comments on commit fe5bb1e

Please sign in to comment.