Rhythmic task controller
You could remove all elements from the queue and then offer them back if necessary.

public void run() {
    ArrayList&lt;Task&gt; tasks = new ArrayList&lt;&gt;();
    {
      Task task;
      while((task = queue.poll()) != null) {
        tasks.add(task);
      }
    }
    for(Task task: tasks) {
      service.submit(() -&gt; {
        if(!task.finish()) offer(task);
      });
    }
}