Amyone help with explaining the JNB loops

I have asked a question like this https://stackoverflow.com/questions/78923495/global-not-seen-outside-zmq-asynch-cell-in-jupyter-lab-notebook in the past and got no answer. I have read the jnb docs but still don’t get why my code doesn’t work. It should. I am missing something to do with blocking and I can’t see it. SO, if anyone has seen or read a description of the JNB loop and how to implement a real time loop inside it which allows a global to be accessed I would be grateful. This is not a criticism of this forum OR this wonderful technology, it IS a request for help.