Plugin lifecycle

Plugin lifecycle A lifecycle diagram generated by Archify. 01 / Lifecycle 02 / User-disabled + Load failure 03 / Outcomes Discovered · PluginHost scans *.dll · Lifecycle 01 Discovered PluginHost scans *.dll Registered · PluginRegistry slot · Lifecycle · unique id 02 Registered PluginRegistry slot unique id Constructed · new(IPluginServices) · Lifecycle 03 Constructed new(IPluginServices) Running · events + Update ticks · Lifecycle 04 Running events + Update ticks Disposed · framework shutdown · Lifecycle 05 Disposed framework shutdown Errored · constructor threw · Load failure · retryable Errored constructor threw retryable Disabled · instance disposed · User-disabled · persisted Disabled instance disposed persisted disable enable throws Retry Legend start active state waiting decision terminal success failure / exit

Your contract

  • • One public IStellarPlugin with a ctor taking IPluginServices
  • • Subscribe in the constructor, detach everything in Dispose
  • • Dispose may run mid-session, not only at shutdown

Failure handling

  • • A throwing constructor never crashes the framework
  • • Duplicate plugin ids: the second copy is ignored
  • • Disabled state persists across restarts