Fork me on GitHub

wasn't there talk about promise-chans being dereferable? was that dropped or am I completely mistaken?


found the quote by rich, actually it was channels in general


also found an open issue for it, so question answered:

Alex Miller (Clojure team)14:01:59

it was not dropped but it's annoyingly hard to implement cleanly (without introducing namespace cycles)


newbie question: is there a sliding buffer that can drop items based on length of time in the buffer aka time based sliding window?


@raymcdermott: There’s nothing like that built-in. You could try to implement it yourself. However, I would suggest trying to see if you could re-frame the problem in terms of timeout instead. When you pair channels with timeout, you can do quite a bit of sophisticated stuff.


@jgdavey: I’m struggling to re-frame it like that to be honest - could be a limit of my imagination!


If you were to implement yourself, you could make a go that simply pulls from a channel, and adds to another as a [timestamp item] pair, then finally pushes into an unbounded chan that has a transducer that filters based on age of that timestamp


does that mean putting the burden on the consumer?


@jgdavey: ok, no … I think I see … the channel has the filter so the consumer just sees the result of the transducer …. I’ll have a go (pun not intended)


just wondering if something like this is doable (in ClojureScript version of core.async):