Emit `close` event when the iteration is finished