This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-25
Channels
- # aatree (3)
- # admin-announcements (14)
- # aws (2)
- # beginners (23)
- # boot (58)
- # braid-chat (15)
- # cider (8)
- # clara (5)
- # cljs-dev (1)
- # cljsrn (38)
- # clojure (82)
- # clojure-china (2)
- # clojure-czech (16)
- # clojure-dev (11)
- # clojure-finland (1)
- # clojure-ireland (6)
- # clojure-japan (3)
- # clojure-portugal (1)
- # clojure-russia (152)
- # clojure-sg (7)
- # clojurebridge (3)
- # clojurescript (86)
- # code-reviews (3)
- # core-matrix (4)
- # cursive (25)
- # data-science (1)
- # datascript (2)
- # datavis (98)
- # datomic (21)
- # dirac (97)
- # emacs (1)
- # hoplon (1)
- # jobs (2)
- # ldnclj (21)
- # off-topic (3)
- # om (204)
- # pedestal (3)
- # proton (12)
- # reagent (125)
- # ring-swagger (9)
- # slackpocalypse (1)
- # spacemacs (1)
- # vim (1)
- # yada (19)
(defn query-stores [product stores]
(let
[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?
@surreal.analysis: Thanks a bunch!
You're welcome! There are a few other options under websockets here: http://www.clojure-toolbox.com/ 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
funny to see it's made its way around the world hehe
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 https://github.com/Engelberg/instaparse is pretty unique and amazing, and Antlr is available e.g. https://github.com/aphyr/clj-antlr 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: http://gorilla-repl.org/. http://thi.ng labs has been innovating in this space for several years and has a bunch of open source libraries to share: https://medium.com/@thi.ng/workshop-report-building-linked-data-heatmaps-with-clojurescript-thi-ng-102e0581225c#.xirs9i4ip. another interesting new effort is metabase: http://www.metabase.com/
Thank you @jonahbenton! That's a great set of leads.