In an event-driven environment, how should a “cancel” function abort all further events?
https://softwareengineering.stackexchange.com/questions/188669
-
05-11-2019 - |
Question
In my iOS app, things are mostly driven by events.
- The user presses a button
- The app listens for an external device to be connected to the iOS device
- Once the device is detected (is connected), an asynchronous call is made to a web service (to check for user authenticity)
- The web service returns the user's authenticity (such as a boolean)
- Another asynchronous web service is called for a stage 2 authenticity
- Result is returned
My question is: If I give the user a dialog box saying "Please wait, processing" and I give them a "Cancel" button, how should I (or how might I) abort everything that's happening?
One way to do this is to simply have a boolean called "userDidCancelEverything" and every event-driven method checks to see if this is true. This seems ugly though.
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with softwareengineering.stackexchange