Add an example about the callback to check if it reaches the end.