Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
cnautze committed Sep 11, 2024
1 parent 5466b6c commit aa8fa84
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
38 changes: 19 additions & 19 deletions src/exoscale/vinyl/cursor.clj
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,25 @@
transducing call needs to be done (stateful transducer)."
[^RecordCursor cursor completion? cont-fn reducer acc]
(.thenApply
(AsyncUtil/whileTrue
(reify Supplier
(get [_]
(-> cursor
.onNext
(.thenApply
(fn/make-fun
(fn [^RecordCursorResult result]
(when (ifn? cont-fn)
(-> result .getContinuation .toBytes cont-fn))
(let [next? (.hasNext result)
new-acc (when next? (swap! acc reducer (.get result)))]
(and (not (reduced? new-acc)) next?))))))))
(.getExecutor cursor))
(fn/make-fun (fn [_]
(unreduced
(cond-> @acc
completion?
reducer))))))
(AsyncUtil/whileTrue
(reify Supplier
(get [_]
(-> cursor
.onNext
(.thenApply
(fn/make-fun
(fn [^RecordCursorResult result]
(when (ifn? cont-fn)
(-> result .getContinuation .toBytes cont-fn))
(let [next? (.hasNext result)
new-acc (when next? (swap! acc reducer (.get result)))]
(and (not (reduced? new-acc)) next?))))))))
(.getExecutor cursor))
(fn/make-fun (fn [_]
(unreduced
(cond-> @acc
completion?
reducer))))))

(defn apply-transduce
"A variant of `RecordCursor::reduce` that honors `reduced?` and supports
Expand Down
10 changes: 5 additions & 5 deletions test/exoscale/vinyl/cursor_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
reducer (transducer reducer-fn)
acc (atom [])]
@(store/run-async *db* (fn [_store] (apply-transduce-with-reducer
cursor
transducer
nil
reducer
acc)))))))))
cursor
transducer
nil
reducer
acc)))))))))

0 comments on commit aa8fa84

Please sign in to comment.