Singleton task dependence

Since you mentioned running a while loop, perhaps this is what you need?

and if you are looking for event-driven processing, you may look at the pattern shown here: