How phoenixframework/flame works
Main Components
a) Core Components:
• FLAME Pool (Central orchestrator)
• Backends (FlyBackend and LocalBackend)
• Runner (Execution environment)
• Queue (Job management)
• Terminator (Resource cleanup)
• CodeSync (Code synchronization)
• Parser (JSON handling)
b) External Integration:
• Host Application
• Infrastructure Provider (e.g., Fly.io)
• Temporary Application Instances
┌─ Host Application Layer ─────────────────────┐
• ┌─ FLAME Core ──────────────────────────┐ │
• ┌─ Pool Management ─┐ ┌─ Queue ─┐ │ │
• ┘ └─────────┘ │ │
• ┌─ Backend Interface ─────────────┐ │ │
• (FlyBackend/LocalBackend) │ │ │
• ┘ │ │
• ┘ │
• ┘
┌─ Infrastructure Layer ────────────────────────┐
• ┌─ Runner 1 ─┐ ┌─ Runner 2 ─┐ ┌─ ... ─┐ │
• ┘ └────────────┘ └───────┘ │
• ┘
Component Relationships
• Function calls (FLAME.call/cast) from Host App → FLAME Core
• Pool management flows
• Backend communication with infrastructure
• Runner lifecycle management
Implementation Details
• Supervision tree structure
• Backend implementation options
• Parser and code sync mechanisms
• Terminator cleanup processes
Job Submission Flow
Host App → FLAME.call → Pool → Queue → Runner → Result
Runner Lifecycle
Pool → Backend → Infrastructure → Runner Creation → Execution → Termination
Additional Notes
• Configuration parameters
• Monitoring points
• Error handling paths
• Cleanup mechanisms
Remember to maintain a balance between showing the complexity of the system while keeping it clear and understandable. The key is to highlight how FLAME enables treating the entire application as a lambda function that can be executed on temporary infrastructure.