Fork me on GitHub
#clojure
<
2016-04-17
>
dg01:04:11

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

vincentdm01:04:10

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?

vincentdm02:04:12

I found it, nevermind

dmh4307:04:47

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).

dmh4308:04:52

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

borkdude08:04:42

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

jumar10:04:07

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)) ?

pbostrom11:04:32

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

jumar11:04:48

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).

jumar11:04:26

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

jumar11:04:27

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.

thiagofm16:04:04

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?

vincentdm17:04:44

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`).

vincentdm17:04:19

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...

banashark18:04:34

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

banashark18:04:01

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

vincentdm18:04:35

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

vincentdm18:04:03

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

banashark18:04:08

@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: http://stackoverflow.com/questions/16270805/how-to-get-the-version-of-the-current-clojure-project-in-the-repl

thiagofm18:04:13

@banashark: thanks, will take a look

vincentdm18:04:01

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.

banashark18:04:15

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.

richiardiandrea18:04:42

I did it, I downloaded racket in order to try Typed Racket after the inspiring keynote at Clojure/West https://youtu.be/XTl7Jn_kmio 😄

jeff-ster23:04:45

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?

jeff-ster23:04:20

I was following the simple instructions on the CIDER github README