Files
NebulaShell/store/@{FutureOSS}/lifecycle.disabled
Falck e72818399c update project configuration and add development tools
- Add Python virtual environment patterns to .gitignore
- Replace .codebuddy with .clinerules in .gitignore
- Add .pid file for process tracking
- Add comprehensive .pylintrc configuration for Python linting
- Update start.bat with English translations and simplified functions
2026-04-19 12:00:02 +08:00
..
2026-04-17 23:15:15 +08:00
2026-04-17 23:15:15 +08:00
2026-04-17 23:15:15 +08:00
2026-04-17 23:15:15 +08:00

lifecycle 生命周期管理

管理插件的状态转换和钩子函数。

功能

  • 状态机:pendingrunningstopped
  • 支持状态转换验证
  • 提供生命周期钩子:
    • before_start
    • after_start
    • before_stop
    • after_stop
  • 支持扩展能力注入

状态转换

pending → running → stopped
              ↕
          (可重启)

使用

lc = lifecycle_plugin.create("my-plugin")
lc.on("after_start", lambda: print("started"))
lc.start()