Skip to content

Latest commit

 

History

History
37 lines (23 loc) · 908 Bytes

File metadata and controls

37 lines (23 loc) · 908 Bytes

Cloudflare Worker and Durable Object Monorepo Examples

typesafe and fun

Examples

Durable Object

  • State persistence
  • SQLite database
  • Object storage
  • WebSocket connection
  • Request/Response with rpc

Worker to Worker

  • worker A server using hono
  • rpc communication with worker B
  • worker B uses worker entrypoint

Cyclical Worker

  • worker entrypoint
  • spawn the same worker recursively
  • make a bunch of outgoing connections in parallel

TODO: Cyclical Worker to Worker

  • might be an antipattern. Deployment is a pain and will probs need be in two stages. You get an error deploying a worker with a non existent binding.

Mini hacks and bugs

Setting the ports for the workers in the dev scripts allows you to run all the workers locally with npm run dev.


Thanks to @threepointone for all the help getting setup.