| // Copyright 2017 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| library fuchsia.modular; |
| |
| /// State used to notify about state transitions of a Module |
| /// instance. This is very similar to the StoryState, however it's not entirely |
| /// the same and hence a separate type. A module cannot have an INITIAL state, |
| /// because it's started as soon as it is created, and it gets deleted as soon as |
| /// it reaches the STOPPED state, whileas a story can be restarted. |
| /// |
| /// Currently possible state transitions (and the events that cause |
| /// them) are: |
| /// |
| /// -> RUNNING ModuleContext.AddModuleToStory() or |
| /// ModuleContext.EmbedModule() or |
| /// StoryController.AddModule() |
| /// RUNNING -> STOPPED ModuleController.Stop() or StoryController.Stop() |
| /// RUNNING -> ERROR application exits |
| type ModuleState = strict enum { |
| /// Module instance was created. |
| RUNNING = 2; |
| /// Module instance is stopped after Module.Stop(). No further transitions are |
| /// to be expected. |
| STOPPED = 4; |
| /// Connection to the Module instance was closed without Stop() request. No |
| /// further transitions are to be expected. |
| ERROR = 5; |
| }; |