How do I share a Durable Object with another worker locally?
According to https://community.cloudflare.com/t/durable-objects-access-from-different-workers/316511
, I can do this:
Start two workers locally with these commands:
w1: wrangler dev src/index.ts --experimental-local --port 8701
w2: wrangler dev src/index.ts --experimental-local --port 8702
w1:
[durable_objects]
bindings = [{name = "WSDO", class_name = "Wsdo"}]
w2:
[durable_objects]
bindings = [{ name = "WSDO", class_name = "Wsdo", script_name = "w1" }]
It seems to be undocumented that this is not possible to do locally? The env
var of w2 is an empty object.
The other method of worker-to-worker communication is to use services, again it seems to be undocumented that this does not work locally.
https://github.com/cloudflare/workers-sdk/issues/1182
Miniflare seems to have a bunch of extra config that wrangler dev
ignores?
Is there a way to configure workerd
to allow cross worker durable object bindings?
How should I be developing locally? It seems developing locally only works for a single worker, and everything else is broken and not documented?