clj-commons/claypoole

Default threadpool uses unbounded queue

kapilreddy opened this issue · 2 comments

com.climate.claypoole/threadpool creates an instance of ScheduledThreadPoolExecutor

It uses an unbounded queue which leads a silent accrue leading to exhaustion of resources.

Also we don't get finer control over what should be done when pool and queue are exhausted.

Proposed solution,

  • Use java.util.concurrent.ThreadPoolExecutor
  • Provide API for,
    ** queue size
    ** Selecting different policies. ie AbortPolicy, CallerRunsPolicy

The design permits you to create a threadpool of your own choice and use that. Does that meet your need here?

Yup, I love that I can create a thread pool of my choice, and it just works.

I was thinking of the library defaults. If that's something you don't think shouldn't change, we can add an example and a section in the documentation.