Skip to content

Conversation

@mgtm98
Copy link
Collaborator

@mgtm98 mgtm98 commented Dec 18, 2025

Description

Implemented hot-reload by invoking a new process that actually calls jac-scal,e and the main process will watch the files. If a file has changed, then the invoked process will be terminated a new process will be created. Check the diagram below digaram

Parent Process (Watcher)          Child Process (Server)
┌──────────────────┐              ┌──────────────────┐
│ Watches .jac     │─────spawn────│ Runs uvicorn     │
│ files using      │              │ on port 8000     │
│ watchfiles       │              │                  │
└──────────────────┘              └──────────────────┘
        │                                  │
        │ File change detected!            │
        │                                  │
        ├──── process.terminate() ─────►  │
        │                                  │
        │      Wait 3 seconds...           │
        │                                  │
        │                                  ✗ Process exits
        │                                    Port 8000 released
        │
        ├──── Spawn new child ─────────►  
        │                              ┌──────────────────┐
        │                              │ Fresh Python     │
        │                              │ Fresh compilation│
        │                              │ Fresh endpoints  │
        │                              │ Binds port 8000  │
        │                              └──────────────────┘

@mgtm98 mgtm98 requested a review from juzailmlwork December 18, 2025 16:24
@RandiJay96 RandiJay96 moved this to In Progress PR in Core Stack Hacking Dec 19, 2025
@RandiJay96 RandiJay96 moved this from In Progress PR to Review in Core Stack Hacking Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Review

Development

Successfully merging this pull request may close these issues.

2 participants