Skip to content

Commit 4e503ce

Browse files
committed
Durable Object instance -> Durable Object
1 parent b531956 commit 4e503ce

File tree

6 files changed

+27
-27
lines changed

6 files changed

+27
-27
lines changed

src/content/docs/durable-objects/api/id.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import { Render, Tabs, TabItem } from "~/components";
99

1010
## Description
1111

12-
A Durable Object ID is a 64-digit hexadecimal number used to identify a Durable Object instance. Not all 64-digit hex numbers are valid IDs. Durable Object IDs are constructed indirectly via the [`DurableObjectNamespace`](/durable-objects/api/namespace) interface.
12+
A Durable Object ID is a 64-digit hexadecimal number used to identify a Durable Object. Not all 64-digit hex numbers are valid IDs. Durable Object IDs are constructed indirectly via the [`DurableObjectNamespace`](/durable-objects/api/namespace) interface.
1313

14-
The `DurableObjectId` interface refers to a new or existing Durable Object instance. This interface is most frequently used by [`DurableObjectNamespace::get`](/durable-objects/api/namespace/#get) to obtain a [`DurableObjectStub`](/durable-objects/api/stub) for submitting requests to a Durable Object instance. Note that creating an ID for a Durable Object instance does not create the Durable Object. The Durable Object is created lazily after creating a stub from a `DurableObjectId`. This ensures that objects are not constructed until they are actually accessed.
14+
The `DurableObjectId` interface refers to a new or existing Durable Object. This interface is most frequently used by [`DurableObjectNamespace::get`](/durable-objects/api/namespace/#get) to obtain a [`DurableObjectStub`](/durable-objects/api/stub) for submitting requests to a Durable Object. Note that creating an ID for a Durable Object does not create the Durable Object. The Durable Object is created lazily after creating a stub from a `DurableObjectId`. This ensures that objects are not constructed until they are actually accessed.
1515

1616
:::note[Logging]
1717

18-
If you are experiencing an issue with a particular Durable Object instance, you may wish to log the `DurableObjectId` from your Worker and include it in your Cloudflare support request.
18+
If you are experiencing an issue with a particular Durable Object, you may wish to log the `DurableObjectId` from your Worker and include it in your Cloudflare support request.
1919

2020
:::
2121

src/content/docs/durable-objects/api/namespace.mdx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import { Render, Tabs, TabItem } from "~/components";
99

1010
## Description
1111

12-
A Durable Object namespace is a set of Durable Object instances that are backed by the same Durable Object class. There is only one Durable Object namespace per class. A Durable Object namespace can contain any number of Durable Object instances.
12+
A Durable Object namespace is a set of Durable Objects that are backed by the same Durable Object class. There is only one Durable Object namespace per class. A Durable Object namespace can contain any number of Durable Objects.
1313

14-
The `DurableObjectNamespace` interface is used to obtain a reference to new or existing Durable Object instances. The interface is accessible from the fetch handler on a Cloudflare Worker via the `env` parameter, which is the standard interface when referencing bindings declared in `wrangler.toml`.
14+
The `DurableObjectNamespace` interface is used to obtain a reference to new or existing Durable Objects. The interface is accessible from the fetch handler on a Cloudflare Worker via the `env` parameter, which is the standard interface when referencing bindings declared in `wrangler.toml`.
1515

16-
This interface defines several [methods](/durable-objects/api/namespace/#methods) that can be used to create an ID for a Durable Object instance. Note that creating an ID for a Durable Object instance does not create the Durable Object. The Durable Object is created lazily after calling [`DurableObjectNamespace::get`](/durable-objects/api/namespace/#get) to create a [`DurableObjectStub`](/durable-objects/api/stub) from a `DurableObjectId`. This ensures that objects are not constructed until they are actually accessed.
16+
This interface defines several [methods](/durable-objects/api/namespace/#methods) that can be used to create an ID for a Durable Object. Note that creating an ID for a Durable Object does not create the Durable Object. The Durable Object is created lazily after calling [`DurableObjectNamespace::get`](/durable-objects/api/namespace/#get) to create a [`DurableObjectStub`](/durable-objects/api/stub) from a `DurableObjectId`. This ensures that objects are not constructed until they are actually accessed.
1717

1818
<Tabs> <TabItem label="JavaScript" icon="seti:javascript">
1919

@@ -31,7 +31,7 @@ export default {
3131
// Every unique ID refers to an individual instance of the Durable Object class
3232
const id = env.MY_DURABLE_OBJECT.idFromName("foo");
3333

34-
// A stub is a client Object used to invoke methods defined by the Durable Object instance
34+
// A stub is a client Object used to invoke methods defined by the Durable Object
3535
const stub = env.MY_DURABLE_OBJECT.get(id);
3636
...
3737
}
@@ -58,7 +58,7 @@ export default {
5858
// Every unique ID refers to an individual instance of the Durable Object class
5959
const id = env.MY_DURABLE_OBJECT.idFromName("foo");
6060

61-
// A stub is a client Object used to invoke methods defined by the Durable Object instance
61+
// A stub is a client Object used to invoke methods defined by the Durable Object
6262
const stub = env.MY_DURABLE_OBJECT.get(id);
6363
...
6464
}
@@ -71,7 +71,7 @@ export default {
7171

7272
### `idFromName`
7373

74-
`idFromName` creates a unique [`DurableObjectId`](/durable-objects/api/id) which refers to an individual instance of the Durable Object class. Named Durable Object instances are the most common method of referring to Durable Object instances.
74+
`idFromName` creates a unique [`DurableObjectId`](/durable-objects/api/id) which refers to an individual instance of the Durable Object class. Named Durable Objects are the most common method of referring to Durable Objects.
7575

7676
```js
7777
const fooId = env.MY_DURABLE_OBJECT.idFromName("foo");
@@ -80,15 +80,15 @@ const barId = env.MY_DURABLE_OBJECT.idFromName("bar");
8080

8181
#### Parameters
8282

83-
- A required string to be used to generate a [`DurableObjectId`](/durable-objects/api/id) corresponding to the name of a Durable Object instance.
83+
- A required string to be used to generate a [`DurableObjectId`](/durable-objects/api/id) corresponding to the name of a Durable Object.
8484

8585
#### Return values
8686

8787
- A [`DurableObjectId`](/durable-objects/api/id) referring to an instance of a Durable Object class.
8888

8989
### `newUniqueId`
9090

91-
`newUniqueId` creates a randomly generated and unique [`DurableObjectId`](/durable-objects/api/id) which refers to an individual instance of the Durable Object class. IDs created using `newUniqueId`, will need to be stored as a string in order to refer to the same Durable Object again in the future. For example, the ID can be stored in Workers KV, another Durable Object instance, or in a cookie in the user's browser.
91+
`newUniqueId` creates a randomly generated and unique [`DurableObjectId`](/durable-objects/api/id) which refers to an individual instance of the Durable Object class. IDs created using `newUniqueId`, will need to be stored as a string in order to refer to the same Durable Object again in the future. For example, the ID can be stored in Workers KV, another Durable Object, or in a cookie in the user's browser.
9292

9393
```js
9494
const id = env.MY_DURABLE_OBJECT.newUniqueId();
@@ -99,7 +99,7 @@ const euId = env.MY_DURABLE_OBJECT.newUniqueId({ jurisdiction: "eu" });
9999

100100
The first time you get a Durable Object stub based on an ID derived from a name, the system has to take into account the possibility that a Worker on the opposite side of the world could have coincidentally accessed the same named Durable Object at the same time. To guarantee that only one instance of the Durable Object is created, the system must check that the Durable Object has not been created anywhere else. Due to the inherent limit of the speed of light, this round-the-world check can take up to a few hundred milliseconds. `newUniqueId` can skip this check.
101101

102-
After this first use, the location of the Durable Object instance will be cached around the world so that subsequent lookups are faster.
102+
After this first use, the location of the Durable Object will be cached around the world so that subsequent lookups are faster.
103103

104104
:::
105105

@@ -127,9 +127,9 @@ After this first use, the location of the Durable Object instance will be cached
127127

128128
### `get`
129129

130-
`get` obtains a [`DurableObjectStub`](/durable-objects/api/stub) from a [`DurableObjectId`](/durable-objects/api/id) which can be used to invoke methods on a Durable Object instance.
130+
`get` obtains a [`DurableObjectStub`](/durable-objects/api/stub) from a [`DurableObjectId`](/durable-objects/api/id) which can be used to invoke methods on a Durable Object.
131131

132-
This method returns the stub immediately, often before a connection has been established to the Durable Object instance. This allows requests to be sent to the instance right away, without waiting for a network round trip.
132+
This method returns the stub immediately, often before a connection has been established to the Durable Object. This allows requests to be sent to the instance right away, without waiting for a network round trip.
133133

134134
```js
135135
const id = env.MY_DURABLE_OBJECT.newUniqueId();
@@ -147,7 +147,7 @@ const stub = env.MY_DURABLE_OBJECT.get(id);
147147

148148
### `jurisdiction`
149149

150-
`jurisdiction` creates a subnamespace from a namespace where all Durable Object instance IDs and references created from that subnamespace will be restricted to the specified [jurisdiction](/durable-objects/reference/data-location/#restrict-durable-objects-to-a-jurisdiction).
150+
`jurisdiction` creates a subnamespace from a namespace where all Durable Object IDs and references created from that subnamespace will be restricted to the specified [jurisdiction](/durable-objects/reference/data-location/#restrict-durable-objects-to-a-jurisdiction).
151151

152152
```js
153153
const subnamespace = env.MY_DURABLE_OBJECT.jurisdiction("foo");

src/content/docs/durable-objects/api/stub.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import { Render } from "~/components";
99

1010
## Description
1111

12-
The `DurableObjectStub` interface is a client used to invoke methods on a remote Durable Object instance. The type of `DurableObjectStub` is generic to allow for RPC methods to be invoked on the stub.
12+
The `DurableObjectStub` interface is a client used to invoke methods on a remote Durable Object. The type of `DurableObjectStub` is generic to allow for RPC methods to be invoked on the stub.
1313

1414
Durable Objects implement E-order semantics, a concept deriving from the [E distributed programming language](<https://en.wikipedia.org/wiki/E_(programming_language)>). When you make multiple calls to the same Durable Object, it is guaranteed that the calls will be delivered to the remote Durable Object in the order in which you made them. E-order semantics makes many distributed programming problems easier. E-order is implemented by the [Cap'n Proto](https://capnproto.org) distributed object-capability RPC protocol, which Cloudflare Workers uses for internal communications.
1515

16-
If an exception is thrown by a Durable Object stub all in-flight calls and future calls will fail with [exceptions](/durable-objects/observability/troubleshooting/). To continue invoking methods on a remote Durable Object instance a Worker must recreate the stub. There are no ordering guarantees between different stubs.
16+
If an exception is thrown by a Durable Object stub all in-flight calls and future calls will fail with [exceptions](/durable-objects/observability/troubleshooting/). To continue invoking methods on a remote Durable Object a Worker must recreate the stub. There are no ordering guarantees between different stubs.
1717

1818
<Render file="example-rpc" />
1919

src/content/docs/durable-objects/best-practices/create-durable-object-stubs-and-send-requests.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default {
5353
// Every unique ID refers to an individual instance of the Durable Object class
5454
const id = env.MY_DURABLE_OBJECT.idFromName("foo");
5555

56-
// A stub is a client used to invoke methods on the Durable Object instance
56+
// A stub is a client used to invoke methods on the Durable Object
5757
const stub = env.MY_DURABLE_OBJECT.get(id);
5858

5959
// Methods on the Durable Object are invoked via the stub
@@ -90,7 +90,7 @@ export default {
9090
// Every unique ID refers to an individual instance of the Durable Object class
9191
const id = env.MY_DURABLE_OBJECT.idFromName("foo");
9292

93-
// A stub is a client used to invoke methods on the Durable Object instance
93+
// A stub is a client used to invoke methods on the Durable Object
9494
const stub = env.MY_DURABLE_OBJECT.get(id);
9595

9696
// Methods on the Durable Object are invoked via the stub
@@ -150,7 +150,7 @@ export default {
150150
// Every unique ID refers to an individual instance of the Durable Object class
151151
const id = env.MY_DURABLE_OBJECT.idFromName("foo");
152152

153-
// A stub is a client used to invoke methods on the Durable Object instance
153+
// A stub is a client used to invoke methods on the Durable Object
154154
const stub = env.MY_DURABLE_OBJECT.get(id);
155155

156156
// Invoke the fetch handler on the Durable Object stub
@@ -208,7 +208,7 @@ export default {
208208
// Every unique ID refers to an individual instance of the Durable Object class
209209
const id = env.MY_DURABLE_OBJECT.idFromName("foo");
210210

211-
// A stub is a client used to invoke methods on the Durable Object instance
211+
// A stub is a client used to invoke methods on the Durable Object
212212
const stub = env.MY_DURABLE_OBJECT.get(id);
213213

214214
// Invoke the fetch handler on the Durable Object stub

src/content/docs/durable-objects/get-started/walkthrough.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Render, TabItem, Tabs, PackageManagers } from "~/components";
1010
This guide will instruct you through:
1111

1212
- Writing a Durable Object class.
13-
- Writing a Worker which invokes methods on a Durable Object instance.
13+
- Writing a Worker which invokes methods on a Durable Object.
1414
- Deploying a Durable Object.
1515

1616
## Prerequisites
@@ -139,7 +139,7 @@ export default {
139139
// Every unique ID refers to an individual instance of the Durable Object class
140140
const id = env.MY_DURABLE_OBJECT.idFromName("foo");
141141

142-
// A stub is a client used to invoke methods on the Durable Object instance
142+
// A stub is a client used to invoke methods on the Durable Object
143143
const stub = env.MY_DURABLE_OBJECT.get(id);
144144

145145
// Methods on the Durable Object are invoked via the stub
@@ -159,7 +159,7 @@ export default {
159159
// Every unique ID refers to an individual instance of the Durable Object class
160160
const id = env.MY_DURABLE_OBJECT.idFromName("foo");
161161

162-
// A stub is a client used to invoke methods on the Durable Object instance
162+
// A stub is a client used to invoke methods on the Durable Object
163163
const stub = env.MY_DURABLE_OBJECT.get(id);
164164

165165
// Methods on the Durable Object are invoked via the stub
@@ -174,7 +174,7 @@ export default {
174174

175175
## 5. Configure Durable Object bindings
176176

177-
To allow a Worker to invoke methods on a Durable Object instance, the Worker must have a [Durable Object binding](/workers/runtime-apis/bindings/) in the project's [`wrangler.toml`](/workers/wrangler/configuration/#durable-objects) file. The binding is configured to use a particular Durable Object class.
177+
To allow a Worker to invoke methods on a Durable Object, the Worker must have a [Durable Object binding](/workers/runtime-apis/bindings/) in the project's [`wrangler.toml`](/workers/wrangler/configuration/#durable-objects) file. The binding is configured to use a particular Durable Object class.
178178

179179
```toml
180180
[[durable_objects.bindings]]

src/content/partials/durable-objects/example-rpc.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default {
2626
// Every unique ID refers to an individual instance of the Durable Object class
2727
const id = env.MY_DURABLE_OBJECT.idFromName("foo");
2828

29-
// A stub is a client used to invoke methods on the Durable Object instance
29+
// A stub is a client used to invoke methods on the Durable Object
3030
const stub = env.MY_DURABLE_OBJECT.get(id);
3131

3232
// Methods on the Durable Object are invoked via the stub
@@ -63,7 +63,7 @@ export default {
6363
// Every unique ID refers to an individual instance of the Durable Object class
6464
const id = env.MY_DURABLE_OBJECT.idFromName("foo");
6565

66-
// A stub is a client used to invoke methods on the Durable Object instance
66+
// A stub is a client used to invoke methods on the Durable Object
6767
const stub = env.MY_DURABLE_OBJECT.get(id);
6868

6969
// Methods on the Durable Object are invoked via the stub

0 commit comments

Comments
 (0)