mirror of
https://github.com/penpot/penpot.git
synced 2025-05-04 06:55:53 +02:00
✨ Minor improvements on batching channel impl.
This commit is contained in:
parent
610afc7702
commit
ce19bcd364
1 changed files with 9 additions and 1 deletions
|
@ -81,7 +81,11 @@
|
||||||
(recur (a/timeout max-batch-age) init)))
|
(recur (a/timeout max-batch-age) init)))
|
||||||
|
|
||||||
(nil? val)
|
(nil? val)
|
||||||
(a/close! out)
|
(if (empty? buf)
|
||||||
|
(a/close! out)
|
||||||
|
(do
|
||||||
|
(a/offer! out [:timeout buf])
|
||||||
|
(a/close! out)))
|
||||||
|
|
||||||
(identical? port in)
|
(identical? port in)
|
||||||
(let [buf (conj buf val)]
|
(let [buf (conj buf val)]
|
||||||
|
@ -91,3 +95,7 @@
|
||||||
(recur (a/timeout max-batch-age) init))
|
(recur (a/timeout max-batch-age) init))
|
||||||
(recur tch buf))))))
|
(recur tch buf))))))
|
||||||
out))
|
out))
|
||||||
|
|
||||||
|
(defn thread-sleep
|
||||||
|
[ms]
|
||||||
|
(Thread/sleep ms))
|
||||||
|
|
Loading…
Add table
Reference in a new issue