davianspace_hosting 1.0.3 copy "davianspace_hosting: ^1.0.3" to clipboard
davianspace_hosting: ^1.0.3 copied to clipboard

Enterprise-grade hosting framework for Dart. Unifies configuration, logging, dependency injection, and lifecycle management into a coherent application model.

Changelog #

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

1.0.3 #

Added #

  • Core abstractions: Host, HostBuilder, HostContext, HostedService abstract interfaces defining the hosting contract.
  • Default host builder (createDefaultBuilder): Pre-configured builder with appsettings.json, environment-specific config, environment variables, CLI argument parsing, and console logging.
  • Host implementation (HostImpl): Full lifecycle management with AsyncLock-protected start/stop, SIGINT/SIGTERM signal handling, and orderly teardown.
  • Application lifetime (ApplicationLifetime): One-shot event hooks for started, stopping, and stopped transitions with programmatic shutdown via requestShutdown().
  • Lifetime events (LifetimeEvents): Single-invocation callback list with error collection and late-add-fires-immediately semantics.
  • Hosted service executor (HostedServiceExecutor): Sequential and concurrent start/stop orchestration with startup rollback and stop-error collection.
  • Hosted service collection (HostedServiceCollection): Dedicated registry for hosted-service factories, solving the DI singleton cache limitation. Includes addHostedService() and addHostedServiceInstance() extension methods on ServiceCollection using onContainerBuilt hooks.
  • Environment detection: HostContext with isDevelopment, isStaging, isProduction convenience getters. Resolution from DART_ENVIRONMENT env var → Hosting:Environment config key → Production default.
  • Async lock (AsyncLock): Lightweight async mutex preventing concurrent lifecycle transitions.
  • Framework service registration: Automatic registration of Configuration, LoggerFactory, Logger, ApplicationLifetime, HostedServiceCollection, and HostedServiceExecutor in the DI container.
  • Exception types: HostedServiceException, HostedServiceStopException, LifetimeEventException for structured error reporting.
  • Full integration with davianspace_configuration, davianspace_dependencyinjection, davianspace_logging, and davianspace_options.
  • Comprehensive test suite (44 tests).
  • Enterprise-grade documentation: README with API reference, architecture doc, CONTRIBUTING.md, SECURITY.md.
0
likes
160
points
94
downloads

Documentation

API reference

Publisher

verified publisherdavian.space

Weekly Downloads

Enterprise-grade hosting framework for Dart. Unifies configuration, logging, dependency injection, and lifecycle management into a coherent application model.

Repository (GitHub)
View/report issues
Contributing

Topics

#hosting #dependency-injection #configuration #architecture #lifecycle

License

MIT (license)

Dependencies

davianspace_configuration, davianspace_dependencyinjection, davianspace_logging, davianspace_options

More

Packages that depend on davianspace_hosting