I'm designing a piece of software that is a long-running process. During its lifecycle it needs to rotate between a variety of modes or activities based on the state of the system. For example, when it starts up it will perform activity X in a loop until condition A happens, at which point it will perform activity Y until condition B happens, and then it will go back to performing X, etc. There may be an arbitrary number of different modes to rotate through.
Is there an established pattern for software that follows this type of cycle? I looked up Event Loop but that is more for asynchronous handling requests that come in from an external process. I'm looking for something that will cycle through a variety of modes in a predictable manner.
Aucun commentaire:
Enregistrer un commentaire