/*
* wait for a certain time and return null if no task is on the queue.
* If return null --> commit will be called
*/
Future<IndexDocument> retVal = this.taskQueue.poll(this.idleTime, TIME_UNIT);
if(retVal== null)
this.commit.set(true);
return retVal;