Documentation
Concurrency Layer

Parallel Goroutines

Unlike NodeJS which relies on a single-threaded Event Loop, Kitwork empowers you to spin up real, isolated multi-threaded processes.

01

The go() Function

Whenever you wrap an execution block inside go(), Kitwork safely executes it across its Sovereign VM pool.

async.kitwork.js
router.get("/register").handle((req, res) => {
    // 1. Spin up Async background worker
    go(() => {
        network.sendEmail("Welcome!");
        log.Print("Background task running");
    });

    return res.json({ success: true });
});
02

Why Goroutines?

"Standard Javascript runtimes block the execution thread. The go() keyword eliminates these bottlenecks entirely. Never block your HTTP routers again."

03

Thread-Safe Database Queries

Run resource-intensive database calculations in background worker contexts safely without blocking the router execution context.

background-db.js
router.get("/background-job").handle((req, res) => {
    go(() => {
        log.Print("Fetching analytical rows in background...");
        const users = db.table("user").list(100);
        log.Print("Processing count: " + users.length);
    });

    return res.text("Analytics job dispatched.");
});
04

Virtual Machine Pool Architecture

Every request processed by the Kitwork gateway initiates inside an isolated Virtual Machine environment. When dispatching background tasks via go(), execution threads are automatically provisioned from an optimized thread-safe Go worker pool.