agnicore / nfx

.NET Standard Unistack Framework
http://nfxlib.com
Other
75 stars 91 forks source link

Add ability for App modules to get notified on app container init, before cleanup #26

Closed itadapter closed 6 years ago

itadapter commented 6 years ago

Done in 688ce192720cbaf29f174599c3ddf37b6155d234

itadapter commented 6 years ago

See IModuleImplementation

/// <summary>
  /// Describes module implementation
  /// </summary>
  public interface IModuleImplementation : IModule, IDisposable, IConfigurable, IInstrumentable
  {
    /// <summary>
    /// Called by the application container after all services have initialized.
    /// An implementation is expected to notify all subordinate (child) modules.
    /// The call is used to perform initialization tasks such as inter-service dependency fixups,
    /// initial data loads (e.g. initial cache fetch etc..) after everything has loaded in the application container.
    /// The implementation is expected to handle internal exceptions gracefully (i.e. use log etc.)
    /// </summary>
    void ApplicationAfterInit(IApplication application);

    /// <summary>
    /// Called by the application container before services shutdown.
    /// An implementation is expected to notify all subordinate (child) modules.
    /// The call is used to perform finalization tasks such as inter-service dependency cleanups,
    /// buffer flushes etc. before the application container starts to shutdown.
    /// The implementation is expected to handle internal exceptions gracefully (i.e. use log etc.)
    /// </summary>
    void ApplicationBeforeCleanup(IApplication application);
......