Any way to catch a latent function being completed?

Thank for this tutorial. It’s very useful!
​​​​ and Could you have the way to stop or inturrupt the latent that you created?