Fork me on GitHub

Anyone know if it’s possible with prismatic plumbing to control the amount of work done? Basically, iterate one step at a time, producing partial results


I'm calling an async library to upload a dir of file (AWS S3 Transfer using Amazonica) but my program exits before it finishes. Is there some kind of code I can wrap this in so it will wait until all is finished?


I found it, nevermind


Does anyone use partial in preference to using the shorthand for an anonymous function #(… %) ?

Chris O’Donnell07:04:51

@dmh43: partial is nice if your function has several arguments and you want to fill in the first, and figure out the rest later

Chris O’Donnell07:04:34

For example, in an application I'm working on right now, I have a function (defn api-call [resource-name http-client api-key id] ...). I define some convenience functions with (def basic-info (partial api-call :basic-info).


Ah ok, thanks! I knew it was more useful than I thought!


@dmh43: #(...) is shorthand for (fn [..] ...)


I’ve just read the Chapter 6 from Living Clojure about core.async. I’m wondering if the “parking” (asynchronous) versions of put and take really scale properly. My impression is that it should be possible to do many thousands of asynchronous executions like (async\go (async/>! tea-channel :tea)) - and let’s say that we’re not going to consume (take) this messages immediately. If I got it properly the approach is to “park” (make it unavailable for scheduling) the calling thread. Does that mean that new thread is used for each invocation of (async/go (async/>! tea-channel :tea)) ?


@jumar: no, a parked go block does not make the thread unavailable:\#clojure.core.async/go


Well, the following formulation is confusing for me: >>> Additionally, any visible calls to <!, >! and alt!/alts! ? channel operations within the body will block (if necessary) by 'parking' the calling thread rather than tying up an OS thread (or the only JS thread when in ClojureScript).


I understand this as “Java thread is unavailable for another processing but it doesn’t consume CPU - no busy waiting)


btw. when I look at REPL process in jvisualvm I see many threads (thousands) like “async-dispatch-2435” - they are not running, however, just displayed on Threads tab.


Let's say at a certain part of the code I would like to get all the variables accessible by the current scope, can I do it?


Hi all! Can anyone point me to a solution to bake parameters into my uberjar using Leiningen? I tried the environ package but it relies on an external file (`.lein-env`).


So, for example: I want to bake a JAR based on the prod profile in my project.clj which contains some settings for my production environment. Since I'm using AWS Lambda I cannot use native ENV vars or external files...


@thiagofm: try using (ns-map ns). You could probably filter that for variables somehow


that’s ns with stars around it, but slack bolds that


Okay, and how does it relate to params I define in project.clj?


Ok, I see you were answering the previous question. Nevermind simple_smile


@vincentdm: is there a reason you can’t set your profile variable to a string and refer to that in code? then you can just pull in the variable like in this answer:


@banashark: thanks, will take a look


How would I know in my code which profile in the project.clj to refer to? However, in the meanwhile I think I have found what I was looking for: Leiningen lets me pass params using :jvm-opts, so if i can find a way to read those I think I have what I need.


Oh nice yeah that’s a lot cleaner. If your parameter was only for prod, you could just conditionally check if it was not nil, then you would know that you were in prod.


I did it, I downloaded racket in order to try Typed Racket after the inspiring keynote at Clojure/West 😄


Hey all! I am try to setup emacs on windows with CIDER. But its not in the package list. This is a clean install. Quick ideas?


I was following the simple instructions on the CIDER github README