I am looking for a WorkQueue API offering the following features:
java.util.Queuecompatible- offers (optional) Set-semantic
- single- and batch-processing
- concurrency (of course)
- scheduling
- different processing policies
- wait until next scheduled execution
- pre-process, if batch size met
- delayed processing (minimum time in queue, before being processed)
- persistence (optional)
There are a lot of interesting implementations in the jdk, e.g. java.util.DelayQueue which i could use. I just wanted to make sure i am not reinventing the wheel.
Are you still looking for an answer to accept?
I think your needs would best be met using
java.util.concurrent‘s executor framework. See the API (here’s a good start). There’s an excellent support community, you can find it at the concurrency-interest web site. If you’re into dead trees, Java Concurrency in Practice (JCiP) provides an excellent resource.The executor framework allows you to create tasks (in the form of Runnables or Callables), provides several schemes for synchronizing or otherwise ordering tasks with respect to one another.
Finally, the emerging ForkJoin (FJ) infrastructure is quite usable and may match your needs. API is here, a good paper is here, and an introductory article here.
Hope this helps.
JA