Skip to content

Commit 7962809

Browse files
authored
Apply suggestions from code review
1 parent 8df1fe7 commit 7962809

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/content/docs/durable-objects/concepts/durable-object-lifecycle.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import { Render, TypeScriptExample } from "~/components";
1010
This section describes the lifecycle of a [Durable Object](/durable-objects/concepts/what-are-durable-objects/).
1111

1212
To use a Durable Object you need to create a [Durable Object Stub](/durable-objects/api/stub/).
13-
By just creating the Durable Object Stub no request is yet sent to the Durable Object, thus the Durable Object is not yet instantiated.
14-
Only once a method is invoked on the Durable Object Stub a request is actually sent to the Durable Object and its lifecycle begins.
13+
Simply creating the Durable Object Stub does not send a request to the Durable Object, and therefore the Durable Object is not yet instantiated.
14+
A request is sent to the Durable Object and its lifecycle begins only once a method is invoked on the Durable Object Stub.
1515

16-
```javascript
16+
```js
1717
const id = env.MY_DURABLE_OBJECT.idFromName("foo");
1818
const stub = env.MY_DURABLE_OBJECT.get(id);
1919
// Now the request is sent to the remote Durable Object.
@@ -51,7 +51,7 @@ Hibernation can only occur if **all** of the conditions below are true:
5151
- No WebSocket standard API is used.
5252
- No request/event is still being processed, because hibernating would mean losing track of the async function which is eventually supposed to return a response to that request.
5353

54-
After 10 seconds of no incoming request or event and all the above conditions satisfied, the Durable Object will transition into the **hibernated** state.
54+
After 10 seconds of no incoming request or event, and all the above conditions satisfied, the Durable Object will transition into the **hibernated** state.
5555

5656
:::caution
5757
When hibernated, the in-memory state is discarded, so ensure you persist all important information in the Durable Object's storage.

src/content/partials/durable-objects/do-faq-pricing.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### When does a Durable Object incur duration charges?
66

7-
A Durable Object incurs duration charges as long as the JavaScript object has to be in memory, either because it's actively handling a request or because it cannot hibernate.
7+
A Durable Object incurs duration charges as long as the JavaScript object has to be in memory, either because it is actively handling a request, or because it cannot hibernate.
88

99
Once an object has been evicted from memory, the next time it is needed, it will be recreated (calling the constructor again).
1010

0 commit comments

Comments
 (0)