This specialized callback implements a pattern that allows a large job to be broken into smaller tasks using iteration rather than recursion. <p> A typical example is the write of a large content to a socket, divided in chunks. Chunk C1 is written by thread T1, which also invokes the callback, which writes chunk C2, which invokes the callback again, which writes chunk C3, and so forth. </p> <p> The problem with the example is that if the callback thread is the same that performs the I/O operation, then the process is recursive and may result in a stack overflow. To avoid the stack overflow, a thread dispatch must be performed, causing context switching and cache misses, affecting performance. </p> <p> To avoid this issue, this callback uses an AtomicReference to record whether success callback has been called during the processing of a sub task, and if so then the processing iterates rather than recurring. </p> <p> Subclasses must implement method {@link #process()} where the sub task is executed and a suitable {@link IteratingCallback.Action} is returned to this callback to indicate the overall progress of the job. This callback is passed to the asynchronous execution of each sub task and a call the {@link #succeeded()} on this callback represents the completion of the sub task. </p>