Fork me on GitHub

(defn query-stores [product stores]
    [futures (doall  (for [store stores]
                       (future (query store product))))]
  (map deref futures)))
if calling deref on futures means that it blocks, why call future on this process at all? isn’t the point of future so the task will be non-blocking?


It would appear to be used to achieve concurrency here, though it’s not the cleanest way of achieving the desired result, probably.


for returns a lazy seq of futures. map also returns a lazy seq, so whoever begins to realize the result will probably cause chunks of 16 futures to be executed concurrently.


Oh, sorry, missed the doall, that fixes the chunking problem


Hey guys I am trying to write a Slack integration using Clojure. However I am running into problems while creating a websocket client. I tried using gniazdo but that doesnt work with the ring webapp. Any suggestions?


@udit: I've found http-kit to be the simplest to get up and running with


And it's ring compatible


@surreal.analysis: Thanks! I did go though the http-kit library, but it doesnt seem to have support for creating a websocket client, right?


You're welcome! There are a few other options under websockets here: but http-kit should be sufficient / lightweight


I like that. It gets away from the thought that 'I can't ever change this' to 'I can't override what's already there'


@ghadi: that observation originates from a ClojureBridge event btw simple_smile


oh fantastic


funny to see it's made its way around the world hehe


Yay for ClojureBridge!


Hi everyone, Can I ask y'all's advice? I'm trying to learn Clojure, and thinking I'm at the point where I should do a couple small projects in it rather than just stick with books. I'm mostly a data person, and my best/main language is Python, but I also have a few little projects I'm trying to start that mostly involve vast amounts of string manipulation, regex, etc. (for example, I'm kicking around various kinds of academic citation parsers). I don't know Java. Does anyone have any tips for which of these projects, either data science-y stuff or messy stuff with strings, would be the best match for moving small projects to clojure? How good is incanter/is there something better? Thanks!


hey @gowder, welcome. The clojure repl is pretty good for messy work with strings, and does not require any familiarity with Java. Some people use a repl workflow with python- if you do, there are many similarities- but if not, definitely worth getting a feel for it, especially if you're constructing a processing pipeline. If you have text that adheres to a context free grammar, the Instaparse project is pretty unique and amazing, and Antlr is available e.g. when necessary.


there is a lot of interesting work in the data + visualization space. incanter is an older project that has a base of active users, but a new notebook-like tool has seen more recent activity: labs has been innovating in this space for several years and has a bunch of open source libraries to share: another interesting new effort is metabase:


Thank you @jonahbenton! That's a great set of leads.


Wow, instaparse looks really awesome.