Presumably ```bar()``` is the long-running call, and what happens inside this loop is much more granular, so that the cancellation check happens regularly.