0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-10 17:18:21 -05:00

Minor improvements on batching channel impl.

This commit is contained in:
Andrey Antukh 2021-05-14 12:37:44 +02:00 committed by Alonso Torres
parent 610afc7702
commit ce19bcd364

View file

@ -81,7 +81,11 @@
(recur (a/timeout max-batch-age) init)))
(nil? val)
(a/close! out)
(if (empty? buf)
(a/close! out)
(do
(a/offer! out [:timeout buf])
(a/close! out)))
(identical? port in)
(let [buf (conj buf val)]
@ -91,3 +95,7 @@
(recur (a/timeout max-batch-age) init))
(recur tch buf))))))
out))
(defn thread-sleep
[ms]
(Thread/sleep ms))