What problem does it solve?
This Skill provides a robust framework for defining, loading, and managing asynchronous services within a Node.js application, ensuring proper lifecycle management, dependency resolution, and graceful shutdown.
Core Features & Use Cases
- Service Definition: Define services using
defineService with lifecycle management and resource cleanup registration.
- Dependency Injection: Load services within other services using
loadService, automatically handling initialization order and detecting circular dependencies.
- Lifecycle Management: Manages service states (init, ready, stopping, stopped) and provides observable events for monitoring.
- Graceful Shutdown: Ensures all registered cleanup functions are executed when the application shuts down.
- Use Case: Build a microservice where a database service, a cache service, and an authentication service are defined and loaded, with automatic cleanup of connections upon shutdown.
Quick Start
Use the hile-core skill to define and load a simple asynchronous service that returns a greeting.