Diffinery

homeflare/celldpublic

celld/examples/README.md
52 lines · 2.3 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- `facets/` — a Durable Object facet over a class the Worker Loader starts
23- `container/` — a Durable Object that supervises a container with
24 `@cloudflare/containers`; needs `npm install` and a Docker or Podman CLI
25- `sandbox/` — the Cloudflare Sandbox SDK: commands, files, and processes
26 in a container per sandbox; needs `npm install` and a Docker or Podman CLI
27- `pi/` — the PiHarness agent loop in a Durable Object
28- `opencode/` — the OpenCode Workerd SDK in a Durable Object
29- `wasm/` — a Durable Object counter in Rust, compiled to Wasm with
30 [workers-rs](https://github.com/cloudflare/workers-rs); needs a build step
31 first (see its [README](wasm/README.md))
32
33Deploy an example from its directory to the same bucket the nodes use:
34
35```sh
36celld deploy . --bucket s3://my-cells-bucket
37```
38
39The counter example uses the `name` query parameter as the Durable Object
40name. It uses `default` when the parameter is absent. Send requests for
41different names to demonstrate independent cells:
42
43```sh
44curl 'http://127.0.0.1:8080/increment?name=alpha'
45curl 'http://127.0.0.1:8080/increment?name=beta'
46curl 'http://127.0.0.1:8080/increment?name=alpha'
47```
48
49A fleet can place the named cells on different nodes, and each cell keeps an
50independent counter.
51
52They are examples, not the complete compatibility test suite.