Sharing Durable objects between workers

I wanted to know if it is possible to create a durable object and call it from different workers.
My expectations would be that both workers will call the same durable object.

For instance, when I bind the durable object as follows:

// Wranger worker 1
[durable_objects]
bindings = [
  { name = "EXAMPLE_CLASS", class_name = "DurableObjectExample" }
]
Wrangler Worker 2
[durable_objects]
bindings = [
  { name = "EXAMPLE_CLASS", class_name = "DurableObjectExample" }
]

Will it be guaranteed that both workers will hit the same durable object ( because of the same name ) and not a different one per worker?

If it is possible to share DurableObjecct classes, can they be extracted in a NPM package for reusability and referenced in wrangler.toml file?

Best Regards

2 Likes