So, this is my scenario:
I’ve got an UI, where the user can click buttons to connect to several urls.
I do also have a service which connects to an other url every X minuits.
Now I want to let my service check, if currently any other url is loaded (by the user in the UI) before connecting to its own url, because I don’t want the service to interrup the user operation.
Thanks in advance :]
Use booleans to flag wither you are doing something or not. You might also create
enumof states and do checking the service every time you are about to perform action. You might find useful implementingqueuesfor this purpose. For example: If the service perform something you add the element (that can be action or whatever) to the queue and that element waits until its turn comes :).I hope the idea will be helpful.