Releasing d2q, a simple, efficient, generally applicable engine for implementing graph-pulling API servers in Clojure. Feedback wanted!

2018-10-25 Thread Val Waeselynck
I'm happy to release d2q , a library for implementing graph-pulling server backends, playing in the same space as Lacinia or Pathom , with an emphasis on simplicity, generality

Re: (type ...) vs (class ...)

2018-10-25 Thread Rick Moynihan
I think the main intention of type is to be used as a more generic version of class, that lets clojure data participate alongside java objects etc with multi-methods etc. i.e. (defmulti foo type) (defmethod foo java.lang.String [x] :string-dispatched) (defmethod foo :my-clojure-type [x] :my

[ANN] flow 0.3.1

2018-10-25 Thread alex
flow is a tiny library for declarative errors handling without monads https://github.com/dawcs/flow -- 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 mode

Re: Releasing d2q, a simple, efficient, generally applicable engine for implementing graph-pulling API servers in Clojure. Feedback wanted!

2018-10-25 Thread Tom Connors
I scanned through the readme and the tutorial and I'm definitely interested to give this lib a try in my own applications. To answer your questions: - The value prop is clear an appealing, but you might want to add a comparison directly against Om-next in addition to the Pathom comparison - No c

Mail queue thread

2018-10-25 Thread brjann
Hi, First, I would like to briefly present myself to the list. I'm a psychologist and researcher at the Karolinska Institutet in Stockholm, Sweden. I do research within the field of internet-based psychological treatment - which is a field that has grown a lot during the last 10-15 years. I have d

Re: Mail queue thread

2018-10-25 Thread James Reeves
Hi Brjánn, Executing queued jobs in a background thread is a common task, and as it happens there's a set of Java classes to do just that. (let [e (java.util.concurrent.Executors/newSingleThreadExecutor)] (.execute e #(prn "foo")) (.execute e #(prn "bar")) (Thread/sleep 1000) (.execute e

Re: Mail queue thread

2018-10-25 Thread brjann
Hi James, Thanks! How would one create a thread that continuously monitors a mail queue and sends any mails in it? Or do you mean that I would create one thread per mail that I want to send? Wouldn't that create a problem if I'm about to send 1 mails in one go? And thanks for the heads up reg

Re: Mail queue thread

2018-10-25 Thread James Reeves
The Java executor classes are essentially a queue backed by a thread pool of workers. So suppose we create a new executor: (def executor (java.util.concurrent.Executors/newFixedThreadPool 32)) This creates an ExecutorService object with a pool of 32 worker threads. We can pass it a zero-argume

Re: Mail queue thread

2018-10-25 Thread brjann
Hi James, Thank you for the thorough explanation! So if I understand you correctly, if no calls are made to the executor thread, it will just rest silently until queue-email is called again - not consuming any server resources. Are there any recommendations for the number of worker threads when ea

Re: Mail queue thread

2018-10-25 Thread James Reeves
On Thu, 25 Oct 2018 at 19:01, wrote: > Thank you for the thorough explanation! So if I understand you correctly, > if no calls are made to the executor thread, it will just rest silently > until queue-email is called again - not consuming any server resources. > That's essentially correct. Thre

RE: [ANN] 1.10.0-beta4

2018-10-25 Thread Sean Corfield
We have had this in production for all processes for about 24 hours so far. No problems found. Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "If you're not annoying somebody, you're not really alive." -- Margaret Atwood ___

Re: Mail queue thread

2018-10-25 Thread brjann
It seems that I somewhat over-engineered my queue :-) I don't know any Java so this is very helpful! If I want to know the result of the email send within the worker thread, would you recommend sending it back through a channel? One purpose of my queue was to be able to put urgent messages at the

Re: Mail queue thread

2018-10-25 Thread James Reeves
On Thu, 25 Oct 2018 at 21:47, wrote: > It seems that I somewhat over-engineered my queue :-) I don't know any > Java so this is very helpful! > When it comes to Java concurrency, ExecutorService and BlockingQueue cover a lot of bases. > If I want to know the result of the email send within the

An Error spec?

2018-10-25 Thread Didier
I've started to see a pattern in my spec like this: (s/or :success string? :error ::error) And I've been tempted to create my own spec macro for this. But I also thought, maybe Spec itself should have such a spec. (s/error ) What do people think? -- You received this message because y

Re: An Error spec?

2018-10-25 Thread Alex Miller
This is not a pattern that we encourage in Clojure. The standard mechanism for error reporting is exceptions, which are not spec'ed. On Thursday, October 25, 2018 at 8:46:54 PM UTC-5, Didier wrote: > > I've started to see a pattern in my spec like this: > > (s/or :success string? > :error :

Re: Mail queue thread

2018-10-25 Thread Erik Assum
Not knowing your app nor your requirements, but it might also be an idea to separate concerns: Your web-app could store “emails to be sent” in a database table, and you could have a different process reading this table at regular intervals and sending mails, and also marking the emails as sent,

Re: An Error spec?

2018-10-25 Thread Didier
Interesting. I understand that, I guess it's because of my usage of spec. I tend to use spec exclusively at the boundaries. Think serialization. Sometimes, I have a producer which can't handle the error, so it must be serialized and exchanged to the consumer. So say the producer couldn't produc