How fiverr/readiness-manager works
Project Type and Core Components
a. Main Components:
• ReadinessManager Core
• Action Registry
• Event System
• Error Handling System
• Status Management
┌─────────────────────────────────┐
• ReadinessManager │
• ┤
• ready: boolean │
• register() │
• run() │
• onReady() │
• onActionReady() │
• onError() │
• status() │
• ┘
┌─────────────────┐ ┌─────────────────┐
• Action Registry │ │ Event System │
• ┘ └─────────────────┘
┌─────────────────┐ ┌─────────────────┐
• Error Handler │ │ Status Manager │
• ┘ └─────────────────┘
Flow Representation
• Registration flow (→)
• Event propagation (⇢)
• Error handling flow (⇢)
• Status updates (→)
State Management
┌─────────────────────────────────┐
• Action States │
• ┤
• ○ not_started │
• ◇ pending │
• ● resolved │
• ✕ rejected │
• ┘
┌─────────────────┐
• Client App │
• ┬─────────┘
┌───────▼─────────┐ ┌─────────────────┐
• Readiness │ │ External │
• Manager │───▶│ Dependencies │
• ┬─────────┘ └─────────────────┘
┌───────▼─────────┐
• Health Check │
• Endpoint │
• ┘
┌─────────────────────────────────┐
• ┤
• → Synchronous flow │
• ⇢ Asynchronous flow │
• ⇄ Bi-directional communication │
• ● Active state │
• ○ Inactive state │
• ┘
The event subscription system
This will provide a clear visualization of how the library orchestrates application readiness across multiple dependent services while maintaining a clean and understandable architecture.