[ANN] Clojure SYNC in New Orleans in February

2017-10-05 Thread Eric Normand
Hello! I am excited to announce a new Clojure conference I am organizing called *Clojure SYNC ( https://clojuresync.com/ )*. It’s a synchronous event, in a syncretist city with syncopated music, about an async language. On February 15th and 16th, 2018, two hundred Clojurists from around the wo

Re: How to get an error message from Elastisch?

2017-10-05 Thread lawrence . krubner
This problem has become much stranger. Really, I thought I was developing some intuitions about how to write Clojure code, but everything about this seems counter-intuitive. When the app starts, it seems to be broken, doing one write per second to ElasticSearch (on AWS). Then I get an error, a

Re: How to get an error message from Elastisch?

2017-10-05 Thread lawrence . krubner
One last thing, I should mention, if I go through and add " LIMIT 100 " to all the SQL queries, everything works great. That is, when dealing with a few hundred documents, the app seems to work perfectly, and there are no errors. It's only when I try to work with a few million documents that th

Re: How to get an error message from Elastisch?

2017-10-05 Thread lawrence . krubner
Obviously I'm brain-dead, since I forgot to retry the write on failure. So I fixed this now: (defn advance [message db] {:pre [ (= (type message) durable_queue.Task) ]} (let [ ;; 2017-10-05 -- if this is successful, then the return will look like this: ;;

Re: How to get an error message from Elastisch?

2017-10-05 Thread Lubomir Konstantinov
Holding to a head somewhere perhaps? On Thursday, 5 October 2017 19:32:11 UTC+3, lawrence...@gmail.com wrote: > > One last thing, I should mention, if I go through and add " LIMIT 100 " to > all the SQL queries, everything works great. That is, when dealing with a > few hundred documents, the ap

Re: How to get an error message from Elastisch?

2017-10-05 Thread lawrence . krubner
Konstantinov, yes, perhaps, though I can't think where. This is a small app, about 950 lines of code. There is a limited number of places where I can make such a mistake. I do aggregate a lot of data into an atom, and I'm sure there is a lot of contention around the atom, but the Socket timeout

Re: How to get an error message from Elastisch?

2017-10-05 Thread lawrence . krubner
I did find this: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSPerformance.html "Your performance can also be impacted if your application isn’t sending enough I/O requests. This can be monitored by looking at your volume’s queue length and I/O size. The queue length is the number of pe

How to properly spec this simple structure

2017-10-05 Thread Alex Bezhan
down votefavorite I'm trying to spec the following data structure called Connection: {:id "some string" :channel "instance of org.httpkit.server.AsyncChannel" } Here is my spec: (defn make-channel [

spec for a multi-arity function

2017-10-05 Thread Peter Hull
Is there any guidance on how to do the fdef for a function with more than one arity? As an example, this one which takes one or two arguments: (defn report "Report an error code, optionally with a message" ([errno] ...) ([errno msg] ...)) Could be: (s/fdef report :args (s/alt :brie

Re: How to properly spec this simple structure

2017-10-05 Thread Peter Hull
On Thursday, 5 October 2017 19:52:47 UTC+1, Alex Bezhan wrote: > > > > (s/def ::channel (s/spec (::channel-type) > :gen channel-gen)) > > Don't think it's the answer, but should ::channel-type be in parens here? -- You received this message because you are subscribed to

Re: How to properly spec this simple structure

2017-10-05 Thread Alex Miller
On Thursday, October 5, 2017 at 1:52:47 PM UTC-5, Alex Bezhan wrote: > > > > down votefavorite > > > I'm trying to spec the following data structure called Connection: > > {:id "some string" :channel "ins

Re: spec for a multi-arity function

2017-10-05 Thread Alex Miller
On Thursday, October 5, 2017 at 2:02:10 PM UTC-5, Peter Hull wrote: > > Is there any guidance on how to do the fdef for a function with more than > one arity? As an example, this one which takes one or two arguments: > The regex specs can cover multiple options via ?, *, etc. > > (defn repor

Re: spec for a multi-arity function

2017-10-05 Thread Alex Miller
I should also mention that the s/alt one is fine too, but in general I find receiving the same conformed map in either case but with keys either present or absent works better with all your typical Clojure destructuring etc so I prefer the s/? version. On Thursday, October 5, 2017 at 2:34:36 PM

Re: How to properly spec this simple structure

2017-10-05 Thread Alex Bezhan
Yep, it was my mistake to put channel-type in a parenthesis. I removed that but it still fails with the same error. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new

Re: How to properly spec this simple structure

2017-10-05 Thread Alex Bezhan
As to how I wrote the channel-gen generator. It's basically what I could write using some examples and I'm pretty sure it's almost incorrect in the sense that it works inefficiently. I'm new to Clojure, so trying to spec things is super hard for me. -- You received this message because you are

Re: How to properly spec this simple structure

2017-10-05 Thread Alex Bezhan
Can someone explain what I've done wrong and how to do it the right way? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient w

Re: How to properly spec this simple structure

2017-10-05 Thread Peter Hull
On Thursday, 5 October 2017 20:52:10 UTC+1, Alex Bezhan wrote: > > Can someone explain what I've done wrong and how to do it the right way? As I understand it, you will need to code the generator equivalent of (repeatedly make-channel) but I don't know how to do that, sorry. Then I think you ju

Re: How to properly spec this simple structure

2017-10-05 Thread Alex Bezhan
Here is my question on SO. I got the answer. The issue was that I had some garbage code for REPL, that was not commented out and it was producing the error. Sorry for that, I'm just new to Clojure and trying to learn this stuff. -- You received this message because you are subscribed to the Goo

Re: How to properly spec this simple structure

2017-10-05 Thread Alex Bezhan
https://stackoverflow.com/questions/46592767/how-do-i-make-custom-clojure-spec-generator/46594611#46594611 -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members a

Re: How to properly spec this simple structure

2017-10-05 Thread Peter Hull
I will just point out that, in the suggested answer, (gen/return (make-channel)) calls make-channel once, and creates a generator whose output is that same object repeatedly, not a new instance of the class each time. That may not matter, but it's not what (I think) you intended in your original

Re: How to properly spec this simple structure

2017-10-05 Thread Alex Bezhan
Yeah, thanks for noticing, Peter. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe fr