This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-01-03
Channels
- # aleph (1)
- # beginners (99)
- # boot (16)
- # cider (35)
- # cljs-dev (46)
- # cljsrn (7)
- # clojure (152)
- # clojure-austin (7)
- # clojure-dusseldorf (8)
- # clojure-italy (1)
- # clojure-uk (7)
- # clojurescript (3)
- # core-async (12)
- # css (8)
- # cursive (18)
- # datascript (2)
- # datomic (19)
- # defnpodcast (6)
- # duct (3)
- # editors (8)
- # emacs (8)
- # figwheel (1)
- # fulcro (20)
- # hoplon (18)
- # jobs-discuss (5)
- # lein-figwheel (1)
- # luminus (3)
- # lumo (19)
- # off-topic (15)
- # onyx (9)
- # parinfer (2)
- # planck (6)
- # portland-or (7)
- # re-frame (4)
- # reagent (7)
- # remote-jobs (1)
- # ring (6)
- # ring-swagger (4)
- # spacemacs (10)
- # specter (3)
- # unrepl (131)
would it be possible to make a version of alts!
that takes an iterable of channels instead of a vector?
@schmee alts! really only calls nth on the collection you give it. So it could be an array or a seq, iterables would have to be converted to something that supports nth
this is because alts! requires random access to the collection, because it does some randomization of the data internally. alts! will attempt to operate on channels in a non-deterministic way in order to avoid starving some processes
I’m alting over a potentially large vector which is created from the keys of a concurrent hash map. I would like to avoid recreating the vector everytime an element is added or removed from the map since this will be happening a lot
my idea was to maybe use the KeySet
for the map somehow but since random access is required I see now why that won’t work
@schmee optimizing this won't help a whole lot, since internally alts! will be putting these values into an array and doing other things with them
@schmee perhaps, invert the flow? Have all of these sources put into a common channel instead of trying to alt over a lot of channels?