Is there a complicated Java WorkQueue API?

I am looking for a WorkQueue API offering the following features:

  • java.util.Queue
  • offers (optional) Set-semantic
  • single and batch processing
  • concurrency (of course)
  • Planning
  • various processing policies
    • wait for the next scheduled execution
    • preliminary process if the packet size matches
    • deferred processing (minimum time in queue, before processing)
  • persistence (optional)

There are many interesting implementations in jdk, for example. java.util.DelayQueue which I could use. I just wanted to make sure that I was not reinventing the wheel.

+6
java android scheduled-tasks android-asynctask task-queue
source share
4 answers

Are you still looking for an answer to accept?

I think your needs are best met using the java.util.concurrent framework. Check out the API ( here's a good start ). There is an excellent support community, you can find it on the concurrency -interest website . If you are in dead trees, Java Concurrency in Practice (JCiP) provides an excellent resource.

The executing frame allows you to create tasks (in the form of Runnables or Callables), provides several schemes for synchronization or other orders in relation to each other.

Finally, the new ForkJoin (FJ) infrastructure is fully usable and can fit your needs. The API is here , a good article is here , and the introductory article is here .

Hope this helps.

Ja

+2
source share

Check out the Quartz Task Scheduler API

Quartz Features : http://www.quartz-scheduler.org/overview/features.html

I am not sure of its compatibility with java.util.Queue. But it provides most of the functions related to scheduling and completing a task.

+3
source share

The short and direct answer is no. You have to get out on your own or you will just serve as a free tester for other experiments. At the very least, you will spend time creating the system specifically for your needs, knowing all the main parts and being in full control, instead of taking on a large and unknown dependency.

+1
source share

Although it does not have any scheduling functions, the JDK has a java.util.concurrent.SynchronousQueue , which may be useful.

0
source share

All Articles