On Dec 21, 2014 7:17 AM, "Jonathon McKitrick" wrote:
> Well, my goal is to start a go-loop (if possible) at the root level of the
> code that simply parks and waits for a group of emails to be sent. When
> that happens, it would wake up and broadcast the result of the send
> operation via web so
Well, my goal is to start a go-loop (if possible) at the root level of the
code that simply parks and waits for a group of emails to be sent. When
that happens, it would wake up and broadcast the result of the send
operation via web socket back to the browser. I'd like to avoid starting
that loop
You could probably move setting the atom and calling my-wait-loop inside
the try.
(defn test-mailer []
(async/thread
(try
(do
(reset! mailer-status
(mailer/send-speaker-confirmation-notification 1 "
http://localhost";))
(my-wait-loop))
(catch Excep
I'm a little uncertain exactly what your code is trying to do, but I
believe you're trying to notify a bunch of connections after your speaker
notification emails are sent.
In which case, I'd do something like this:
(defn send-notifications []
(try
(mailer/send-speaker-confirmation-notifica
Part of what makes core.async great is that you don't have to use atoms to
communicate between threads in every case. For your case, I don't see what
using an atom gets you. It seems like you could replace the atom with a
channel, and put values on the channel whenever mail is sent. Your code
will