This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-27
Channels
- # bangalore-clj (1)
- # beginners (50)
- # boot (23)
- # cider (19)
- # clara (28)
- # cljsrn (4)
- # clojure (93)
- # clojure-greece (67)
- # clojure-spec (14)
- # clojure-uk (11)
- # clojurebridge (1)
- # clojurescript (151)
- # community-development (1)
- # core-async (19)
- # core-matrix (1)
- # cursive (3)
- # emacs (1)
- # klipse (5)
- # leiningen (5)
- # luminus (3)
- # lumo (22)
- # nyc (1)
- # off-topic (17)
- # om (12)
- # onyx (16)
- # pedestal (5)
- # re-frame (20)
- # reagent (5)
- # spacemacs (10)
- # uncomplicate (2)
- # unrepl (11)
- # untangled (8)
- # vim (1)
quick question on alts! … the documentation says it takes one ready operation from several channels, so I’m doing something dumb in this code …. any help would be appreciated
there is some incorrect interaction between the lazyseq and the alts! … so I need advice on how to make everything async
use mapv if you don't want a lazy-seq
and I don't see how laziness would be an advantage there
you also might want to create the timeout after creating the channels
goal is not to wait for all the ops but to schedule the ops and then read as they become ready
oh - I just noticed "fetch-page" inside your block
if what you need is to run fetch-page multiple times, and read results as they come in, create your chans like this: (mapv #(async/thread (fetch-page %)) usually-reliable-sites)
- that will return instantly, and give you a channel for the result of each fetch-page call
the threads will start eagerly, the chans will be ready to read as the thread finishes
sweet!
async/thread is severely underrated