Re: How does Executors/newScheduledThreadPool know how or where to parallelize work?

2019-01-04 Thread Alan Thompson
If you haven't seen it before, you can use the excellent Claypoole library for many parallel scheduling tasks. Alan On Wed, Jan 2, 2019 at 1:07 PM wrote: > I guess this is more of a JVM question than a Clojure question, unless > Clojure

Re: How does Executors/newScheduledThreadPool know how or where to parallelize work?

2019-01-02 Thread Orestis Markou
If you call future, you will be using the future threadpool which is unbounded. If you know there’s always going to be a small amount of tasks in-flight, you can safely just use future to parallelize your work, and the scheduled executor to trigger trigger the work periodically. Have a look

Re: How does Executors/newScheduledThreadPool know how or where to parallelize work?

2019-01-02 Thread Matching Socks
You are right, this is not a Clojure question. I suppose your scheduled task could put a bunch of tasks on a queue and a thread-pool executor could work the queue in multiple threads. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this

Re: How does Executors/newScheduledThreadPool know how or where to parallelize work?

2019-01-02 Thread Justin Smith
A ScheduledThreadPool doesn't parallelize or partition your work, it schedules tasks and keeps a pool of Thread objects it can reuse for that purpose. If you need a job to be broken into smaller pieces, executed on a schedule, you'll need to implement some sort of coordination. There's some prior

How does Executors/newScheduledThreadPool know how or where to parallelize work?

2019-01-02 Thread lawrence . krubner
I guess this is more of a JVM question than a Clojure question, unless Clojure exerts any special magic here. I'm open to a more Clojure approach than what I have now. Someone suggested I use Executors/newScheduledThreadPool for some recurring work, so I set it up like this: (def