After reading your message again, I think I understand what you are proposing. Unfortunately, in our case, this has to be controlled within the class and the object. So, we cannot rely on the caller for such procedure. So, I think the way I did it is the proper way to achieve that in that particular case. Basically, I created a property lStop. If the object set it to True, once the generator method will be called, the class will act accordingly if lStop is True.