How to broadcast a message from one function and listen out for it in another
<p>I am working on someone else's large complex app in which images are required from many different parts of the code A,B,C,D etc.. but always with calls to the same function Z. Function Z may or may not have the image ready at the point it is called, and if the image is not ready it will immediately return with a temporary one and then carry on working asynchronously scooping the correct one (from the web maybe). I have located the place in the code Z which is executed when the correct image is finally loaded, but now what I need to do is somehow communicate this fact back up to whoever called this function in the first place so that I can persuade the original caller (A,B,C etc) to re-call function Z.</p>

<p>Is there a standard way to do this? what should I look up?</p>
