Diffinery

homeflare/celldpublic

celld/examples/README.md
47 lines · 1.9 KBRaw History
1# Examples
2
3These small Wrangler projects demonstrate the Workers platform that `celld`
4supports, one service or API at a time:
5
6- `hello/` — a stateless Worker `fetch` handler
7- `webapi/` — common Web Platform APIs
8- `counter/` — a SQLite-backed Durable Object
9- `vectordb/` — nearest-color search with a per-object `vec0` index
10- `d1/` — a guestbook on a D1 database
11- `r2/` — object reads, writes, and deletes on an R2 bucket
12- `kv/` — key reads, writes, and deletes in a KV namespace
13- `async/` — a timer and asynchronous Durable Object storage
14- `body/` — request and response bodies
15- `router/` — Worker-to-Durable-Object routing
16- `wsecho/` — WebSocket echo with hibernation
17- `wsclient/` — outbound WebSocket client from a Durable Object
18- `alarm/` — a Durable Object alarm handler
19- `cron/` — a cron trigger that logs each tick
20- `workflow/` — a Workflow that builds a report in one durable step
21- `rpc/` — Durable Object method calls through JS RPC
22- `pi/` — the PiHarness agent loop in a Durable Object
23- `opencode/` — the OpenCode Workerd SDK in a Durable Object
24- `wasm/` — a Durable Object counter in Rust, compiled to Wasm with
25 [workers-rs](https://github.com/cloudflare/workers-rs); needs a build step
26 first (see its [README](wasm/README.md))
27
28Deploy an example from its directory to the same bucket the nodes use:
29
30```sh
31celld deploy . --bucket s3://my-cells-bucket
32```
33
34The counter example uses the `name` query parameter as the Durable Object
35name. It uses `default` when the parameter is absent. Send requests for
36different names to demonstrate independent cells:
37
38```sh
39curl 'http://127.0.0.1:8080/increment?name=alpha'
40curl 'http://127.0.0.1:8080/increment?name=beta'
41curl 'http://127.0.0.1:8080/increment?name=alpha'
42```
43
44A fleet can place the named cells on different nodes, and each cell keeps an
45independent counter.
46
47They are examples, not the complete compatibility test suite.