denoland/celldPublic

self-hosted, distributed Durable Objects

History
DLHZYTCHNWRDRyan Dahl and 5 othersv0.2.03f22aed

README.md

wasm

A Durable Object counter in Rust, compiled to Wasm with workers-rs.

worker-build is the workers-rs build tool. It compiles the crate to wasm32-unknown-unknown, runs wasm-bindgen over the output, and writes the JavaScript entry point (build/worker/shim.mjs) that wrangler.jsonc names as main — you do not write any JavaScript yourself. Install it once, build, and deploy:

rustup target add wasm32-unknown-unknown
cargo install worker-build

worker-build --release
celld deploy . --bucket s3://my-cells-bucket
curl http://localhost:8080/c/hello   # {"lang":"rust","n":1,"name":"hello"}
curl http://localhost:8080/c/hello   # n increments — state lives in the cell
curl http://localhost:8080/c/other   # a different cell, its own counter

See the WebAssembly docs for how celld ships and runs the .wasm module. Contributed by Connor Hindley.