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:
parent
610afc7702
commit
ce19bcd364
1 changed files with 9 additions and 1 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Reference in a new issue