In my app I use some lists (for example: name, points, date) and save them in a Redis CloudDB. So far everything works.
StoreValue, GetValue sometimes take a little longer. If several users access the CloudDB at the same time, there are problems. How can I ensure that access to the database only works when it is not in use?
My idea:
TAG: Database_locked = false or true.
How can I solve that when you click on the “save” button the application waits until the value under Database_locked = true?
The application is currently closed even though it has not yet saved everything in the CloudDb. -> It should only close the screen when everything is saved: While loop?
It should only start saving when no other user is currently saving. What can I insert? (Wait until database unlocked?)
If I continue working immediately after Get_Value, the list is still empty, because he is probably faster at SET Global_index than he has filled the Name list.
Hence, I need the logic in got_Value
Is there a way that it doesn’t run Set Global index until the data is read and the lists are filled? (not Empty)