Fork me on GitHub
#clojure
<
2016-05-17
>
triss00:05:13

ah thanks chaps.

richiardiandrea00:05:45

I was wondering if there are techniques to keep a main alive in case of my threads all being daemon, I am stuck with spawning (.setDaemon (Thread.) false) but there must be a better way (Apache Commons Daemon?)...

richiardiandrea00:05:01

I know, what I am doing is so ugly nobody dares anwering 😄

hiredman02:05:07

I have done that sort of thing, usually by parking the main thread by derefing a promise that is never delivered to, but I don't particularly like it, it is not very neat, I prefer to have the main thread actually parked waiting on the end of execution of any worker threads

maximilian.igl12:05:10

Hi all, I'm new to clojure and would be highly appreciative if someone could help me with a question regarding VisualVM: While playing around with it, I noticed that while the sampler is running, it shows completely different function calls than when I take a snapshot and look at the "Hot Spots" (selecting the repl thread). I was looking around on the internet but couldn't find any answer.

maximilian.igl12:05:37

(I'll be afk for about an hour)

maximilian.igl12:05:35

(I didn't set up any JMX Connection)

st14:05:56

Hi, anyone can point me to examples of unit tests for riemann? I managed to write some very basic tests (basically that my where clause does its job). I’d like to test some expected side effects on events reception. Thanks in advance.

Dustin Getz14:05:59

I am trying to convert between component notation and entity notation (both directions) for datomic entities, Here is my first attempt based on Bobby Calderwood’s datomic helper gist from a few years ago, I am searching for a cleaner way any ideas? https://gist.github.com/dustingetz/985e4960aeeb0e8a429f0eeb05adb22a

john.carnell15:05:46

Hey guys using clj-http and ring. Need to detect when a client is no longer around to send the HTTPResponse back. (We have a long running server process that we want to kill so we dont waste server resources) In GoLang, I could response.CloseNotify(). I there anything similar I could use in Clojure

hiredman16:05:58

with ring it would be much more convoluted, it would likely be less so with an abstraction that isn't so synchronous. you could do it with ring by returning a custom inputstream as the body, with the custom inputstream signaling on close

eraserhd16:05:19

@darwin I saw this. Moving kind of slow on this project, so … I’ll definitely look soon.

eraserhd16:05:59

@arrdem I’ve contributed to rewrite-clj. The parser is… painful. Overcomplicated. I don’t think it can be cleaned up.

codemartin16:05:23

Hi! Is there a function like map, but for nested maps (the data structure)? I imagine something like map-leaves that would apply a transformation to every leaf in a tree. Asking just in case, otherwise I'll bring out the old friends loop and recur...

eraserhd16:05:00

A lot of people seem to reach for records a lot sooner than I do. I often wonder if this is hold-over from OOP, or if there are other reasons.

zane16:05:59

@codemartin: You mean like clojure.walk?

arrdem16:05:18

@eraserhd: I don't think it's that bad personally. Far better than LispReader.java at any rate. As to records, for something perf sensitive like a reader they're kinda a must unless you want to write a bunch of Java.

cupello17:05:53

Hi! Anyone knows a good stubbing library?

hodapp18:05:18

observation: Clojure is much easier to install than Mathematica

payal19:05:48

I am calling an api asynchronously, and want to avoid a call if one of the parameter is null...I tried (string/blank? var) But this did not work as per expectations. There is an exception thrown 'No implementation of method: :take! of protocol' .. Any idea when do we get this exception.. Am I doing anything wrong? would checking with (null? var ) help.. I have no way of checking this code in test, so not able to figure if it would work or not

ddellacosta19:05:01

@payal can you paste the code into a snippet or on a paste site and give us the link? Will be easier to give you suggestions if we can see the code.

jstokes19:05:57

i remember reading once that libraries shouldn’t return core.async channels from functions, but rather take a callback instead. i can’t seem to find where i read this, or the reasoning behind this

jstokes19:05:20

returning a core.async channel makes your client depend on core.async as well?

payal19:05:46

This runs absolutely fine when I send a not-null id..

easystreet19:05:32

jstokes: i recalled seeing that discussed in the google group: https://groups.google.com/d/topic/clojure/nuy2CAA89sI/discussion

jstokes19:05:22

cascada-io: thanks!

dww23:05:22

Is it possible to use prismatic's schema.coerce to coerce to a Record? I get (not (instance? MyRecord a-clojure.lang.PersistentArrayMap)).