Skip to content
Sign up
Workers

Isolated execution. Total memory reclaim.

Run untrusted or CPU-heavy logic in dedicated V8 isolates. A crash in a worker never crashes the host. When a worker stops, the OS reclaims 100% of its memory — we call it the Guillotine.

Each worker runs in its own Node.js worker thread with a private V8 heap. Variables are private, memory is isolated, and thread death is not process death — reliability and responsiveness stop competing with your business logic.

A strict state machine governs every instance: INACTIVE → ACTIVE_FOREGROUND / ACTIVE_BACKGROUND → SUSPENDED → TERMINATING → TERMINATED. Each instance has a pid and an alias, addressable globally or by name. Spawn, activate, suspend, resume, signal, stop — the lifecycle is the API.

Communication uses a correlation-ID protocol: every command carries a monotonic message id, and responses resolve their exact promise. Multiple commands can be in flight without ever mixing up their answers.

invoice.worker.js
class InvoiceWorker extends BaseWorker {
  async activateBackground(ctx) {
    const { payload, logger } = ctx;

    logger.info('Processing…');
    const result = await this.settle(payload);

    return { ok: true, data: result, port: 'done' };
  }
}

// spawn → activate → stop. Memory returns to zero.

What you get

  • Dedicated V8 isolate per worker — crash-safe by construction
  • FSM lifecycle with suspend / resume / signal commands
  • The Guillotine: forceful termination reclaims 100% of memory
  • Correlation-ID protocol — racing commands never cross wires

Built for

01

The PDF that eats a core

OCR, transcoding, big parses — CPU-bound work runs in its isolate while the main event loop keeps serving traffic.

02

Third-party code you did not write

Run integration logic in a worker. If it leaks, loops or dies, the guillotine cleans up and the host never notices.

03

A thousand short jobs a day

Ephemeral workers spawn, run and terminate. Because memory reclaim is total, the ten-thousandth job runs like the first.

Put your platform on the backbone.