Thanks both, good suggestions.
On 15 May 2013 23:38, "Stuart Sierra" wrote:
> Colin Yates wrote:
> > I have a scheduler which creates a future that basically
> > does a (while true (let [next-job (.take queue)]...)),
> > where queue is a LinkedBlockingQueue. The problem is that
> > once it is run
Colin Yates wrote:
> I have a scheduler which creates a future that basically
> does a (while true (let [next-job (.take queue)]...)),
> where queue is a LinkedBlockingQueue. The problem is that
> once it is running, because futures aren't daemon threads
> it hangs lein.
Instead of .take, you can
A couple of approaches:
1. Stop using compojure's 'defroutes'. Generate routes via 'routes' that
close over your service. Try not to do anything that would make this
expensive.
2. Pass it along on a request map via some middleware.
The relevant principle: lifecycle of your component and usage sh
Hi all,
I have a scheduler which creates a future that basically does a (while true
(let [next-job (.take queue)]...)), where queue is a LinkedBlockingQueue.
The problem is that once it is running, because futures aren't daemon
threads it hangs lein. It will ultimately run inside a compojure