How gowdavarun/checkpoint_driven_task_handler works
Main Components
• C Task Handler:
• File: TaskHandler.c
• Purpose: Performs the low-level task execution in chunks, simulates random crashes (memory, I/O, network), and supports checkpoint-driven progress.
• Backend Server:
• Files: server.js, package.json, package-lock.json
• Technology: Node.js with Express
• Role: Provides REST API endpoints (e.g., adding tasks, fetching task lists, recovering tasks, and retrieving crash logs), interfaces with the task handler, and coordinates automatic and manual recovery mechanisms.
• Frontend UI:
• Files: public/index.html, public/script.js, public/styles.css
• Functionality: Displays task progress (using progress bars), shows crash logs, and includes buttons for manual recovery actions. The UI periodically updates (every 2 seconds) for real-time feedback.
Relationships and Interactions
• The Frontend interacts with the Backend REST API:
• The Backend and C Task Handler:
• Data Flow:
• Flows for adding a task (POST /add-task), retrieving task data (GET /tasks), recovering tasks (POST /recover-task/:taskId), and fetching crash logs (GET /crash-log).
Architectural Patterns and Design Principles
• Clearly Separate the Concerns:
• Treat the C-based task handler as a dedicated component for simulation and recovery handling.
• Distinguish the Node.js server as the service layer that provides a well-defined REST API.
• The Frontend UI should be depicted as a consumer of the API.
• Real-time Data/Feedback:
• Automatic refresh mechanism (2-second interval) on the UI that maintains an updated view of the system’s state.