Overview

A worker atoll: pools and shared workers joined to your app through one shared-memory fabric. Threads share a fixed-layout SharedArrayBuffer contract; work is offloaded two ways — task commands (dispatch → result) and state reactivity (field changes drive behavior) — a fluid model that would deadlock or serialize in a single-threaded app.

Install

npm install @atolljs/core

The core package ships the SDK — imported as @atolljs/core. Framework bindings are separate, independently published packages — @atolljs/<framework> — so you only install the framework you actually use.

How it fits together

main thread                                    worker(s)
┌─────────────────────────────┐   postMessage   ┌──────────────────────────┐
│ connectWorker client        │ ─── task ─────▶ │ defineWorker methods     │
│   counter.increment(n)      │ ◀── result ──── │   scan / sort / mutate   │
│                             │                 │        │                 │
│ connector reads / watches   │                 │        ▼                 │
└──────────────┬──────────────┘                 └──────────┬───────────────┘
               │               SharedArrayBuffer           │
               ▼        (same bytes, zero copy)            ▼
        ┌─────────────────────────────────────────────────────────┐
        │  contract: list rows · strings · objects · numbers    │
        └─────────────────────────────────────────────────────────┘

Three layers: contracts (defineSharedMemory + field.*) declare the memory layout once for both threads; the worker pair (defineWorker on the worker side, connectWorker on the main thread) dispatches typed method calls over a lazily-spawned pool; reactivity (observe, watch, defineTask) turns shared fields and task runs into subscribable snapshots the framework bindings adapt.

Import paths

Import pathContentsBundlephobia
@atolljs/coreShared-memory contracts, worker pool, worker bootstrap, observables, tasks, codecs, loggingsize report ↗
@atolljs/reactuseObservable, useSharedValue, useTask — React hookssize report ↗
@atolljs/vueuseObservable, useSharedValue, useTask — Ref-producing composablessize report ↗
@atolljs/solidjscreateObservable, createSharedValue, createTask — Accessorssize report ↗
@atolljs/svelteobservableValue, sharedValue, taskState — rune-backed statesize report ↗
@atolljs/angularobservableSignal, sharedValue, taskState — Signalssize report ↗
@atolljs/nextjsRe-exports the React binding — App Router safe, SSR-readysize report ↗
@atolljs/nodecreateNodePool, createNodeWorker, /shim, withSharedBuffer/bindSharedBuffer; /http adds createHttpCluster, serveHttp, routeHttpGateway, proxyToWorker — HTTP served from inside workerssize report ↗
@atolljs/nestjsAtollModule, @AtollService, @AtollTask, runAtollWorker — pools and housed APIs on node:worker_threadssize report ↗
@atolljs/islandsmountIsland, connectIslandWorker, callbackProp, islandApp — main-thread mounting; /worker exports definePolyWorker/defineMonoWorker, the proxy DOM, emit — framework-neutral, no renderer built insize report ↗
@atolljs/react-islandReact island shell — <Island>, islandComponent, lazyIsland + react-reconciler worker renderersize report ↗
@atolljs/vue-islandVue island shell — AtollIsland, useIsland + createRenderer worker renderersize report ↗
@atolljs/svelte-islandSvelte island shell — island action, createIslandState + Svelte 5 worker renderersize report ↗
@atolljs/solid-islandSolidJS island shell — <Island>, createIsland, islandComponent, lazyIsland + solid-js/universal worker renderersize report ↗
@atolljs/angular-islandAngular island shell — islandComponent facades, atollIsland directive + Renderer2 worker renderersize report ↗

Bindings contain zero domain code — they adapt the SDK's observable primitives to each framework's reactivity model. Your app owns the domain: contracts, worker handlers, and composition. The islands layer is separate: it moves the whole render tree into a worker — see Islands for when that's the right trade. On the server, @atolljs/node/http moves HTTP itself into workers — see Node.js → Clustering.