This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-08
Channels
- # admin-announcements (3)
- # arachne (1)
- # aws (2)
- # beginners (10)
- # boot (287)
- # cider (5)
- # clara (2)
- # cljs-dev (150)
- # cljsjs (2)
- # clojure (99)
- # clojure-austin (1)
- # clojure-brasil (1)
- # clojure-dev (13)
- # clojure-greece (55)
- # clojure-japan (1)
- # clojure-nl (2)
- # clojure-russia (24)
- # clojure-spec (184)
- # clojure-taiwan (1)
- # clojure-uk (45)
- # clojurescript (55)
- # clojurex (1)
- # cursive (20)
- # datascript (16)
- # datomic (1)
- # devcards (4)
- # events (10)
- # figwheel (1)
- # funcool (7)
- # hoplon (48)
- # immutant (1)
- # jobs (6)
- # lambdaisland (2)
- # lein-figwheel (19)
- # mount (36)
- # off-topic (37)
- # om (16)
- # om-next (17)
- # onyx (29)
- # planck (53)
- # proton (1)
- # pure-frame (1)
- # re-frame (40)
- # reagent (44)
- # remote-jobs (1)
- # ring (2)
- # robots (2)
- # rum (5)
- # slack-help (4)
- # spacemacs (27)
- # specter (82)
- # test-check (18)
- # test200 (1)
- # untangled (17)
Usually it’s my Monday train trip that is full of terrors. Or was that torrents. I get confused.
moaning
@korny: i have confirmed that thameslink is full of terrors, independent of the time of day
Has anyone ever had to debounce updates to an Atom? (ie. I will get several updates in quick succession, but only want to take some action 1.5 seconds (or so) after the first one arrived).
I was thinking about starting a timer (maybe at-at) when not already started… and doing it that way
but if two people get on the bus, and the second guy gets de-bounced. You only record one person?
I’ll get three message, one for each passenger.. and I only want to take action after the third...
@thomas: I'd just put them on a channel/queue/buffer and process the buffer every so often.
On your first write, you could spawn a 'singleton' worker, that sleeps for X seconds and then gets to work.
but in other systems I've found the singleton ends up shitting the bed and locking the system up, and a periodic check is more reliable.
The timing would be arbitrary anyway… I reckon somewhere between 1 and 2 seconds would be good.
alternatively, just do all the write to your atom as much as you like, but prevent the changed trigger from firing too frequently (the only reason I can think of you wanting to do this)
I was thinking about writing to the atom regardless (already do that), but then after a small delay do something with it
I guess the downside of using a buffer is that I would check the buffer at a set interval. even though most of the time there isn’t any traffic on it
Just looking at the https://github.com/overtone/at-at docs
@thomas: have you had a look at this: https://stackoverflow.com/questions/35663415/throttle-functions-with-core-async
david nolen’s blog has a debounce
function using core.async - https://github.com/swannodette/swannodette.github.com/blob/e8a26994fcf4e2bdf0cca67e165f5e1706fc192b/code/blog/src/blog/utils/reactive.cljs#L279
@thomas: if you are using react, you could also try using the timer-mixin: https://github.com/reactjs/react-timer-mixin
i’ve got a demo here: https://github.com/ducky427/reagent-timer-demo
Anyone here used http://hackerrank.com before?