Added std::function to be called when the queue is empty.
Added retry support.