DO multi-worker example?
Hi, I'm looking for a multi-worker example where say worker_a calls RPC methods running in a DO whose class implementation lives in worker_b.
The example in the rpc docs shows a services binding to a worker (by name).
Is there an equivalent RPC binding for a DO class using the class_name?
4 Replies
Another way to ask the question maybe:
How do I avoid maintaining DO class (callee) code and worker (caller) code in a single worker?
or maybe rephrasing:
Does all DO access have to go through the same worker implementation as the DO class?
(sorry for the messy thread 😊 )
Sounds like you want the
script_name
part of the DO binding?
https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objectsThank so much @kian - that's the part i was missing 🙏
... I was looking here and was distracted by "environments" instead of focusing on the worker name.
GitHub
[DO] Clarify script_name in durable_objects.bindings by jldec · Pul...
Summary
Consistent wording in the DO Get Started page to clarify the script_name field of durable_objects.bindings.
Link to wrangler.toml docs for more details.
Context: I got a bit stuck configu...