Skip to content

Commit 4fdc745

Browse files
committed
Lifecycle of a DO doc initialisation
1 parent 9a8a940 commit 4fdc745

File tree

10 files changed

+45
-10
lines changed

10 files changed

+45
-10
lines changed

public/__redirects

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,8 @@
492492
/durable-objects/get-started/video-series/serverless-websocket/ /durable-objects/video-tutorials/ 301
493493
/durable-objects/get-started/video-series/ /durable-objects/video-tutorials/ 301
494494

495+
/durable-objects/what-are-durable-objects/ /durable-objects/concepts/what-are-durable-objects/ 301
496+
495497
# email-routing
496498
/email-routing/enable-email-routing/ /email-routing/get-started/enable-email-routing/ 301
497499
/email-routing/get-started/email-addresses/ /email-routing/setup/email-routing-addresses/ 301

src/content/changelog/durable-objects/2025-04-07-durable-objects-free-tier.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ Free plan [limits](/durable-objects/platform/pricing/) apply to Durable Objects
4545

4646
For more information, checkout:
4747

48-
- [Documentation](/durable-objects/what-are-durable-objects/)
48+
- [Documentation](/durable-objects/concepts/what-are-durable-objects/)
4949
- [Zero-latency SQLite storage in every Durable Object blog](https://blog.cloudflare.com/sqlite-in-durable-objects/)

src/content/changelog/durable-objects/2025-06-25-actors-package-alpha.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The new [@cloudflare/actors](https://www.npmjs.com/package/@cloudflare/actors) l
1111

1212
The `@cloudflare/actors` library is a new SDK for Durable Objects and provides a powerful set of abstractions for building real-time, interactive, and multiplayer applications on top of Durable Objects. With beta uasge and feedback, `@cloudflare/actors` will become the recommended way to build on Durable Objects and draws upon Cloudflare's experience building products/features on Durable Objects.
1313

14-
The name "actors" originates from the [actor programming model](/durable-objects/what-are-durable-objects/#actor-programming-model), which closely ties to how Durable Objects are modelled.
14+
The name "actors" originates from the [actor programming model](/durable-objects/concepts/what-are-durable-objects/#actor-programming-model), which closely ties to how Durable Objects are modelled.
1515

1616
The `@cloudflare/actors` library includes:
1717

@@ -28,7 +28,7 @@ import { Storage } from "@cloudflare/actors/storage";
2828

2929
export class ChatRoom extends DurableObject<Env> {
3030
storage: Storage;
31-
31+
3232
constructor(ctx: DurableObjectState, env: Env) {
3333
super(ctx, env)
3434
this.storage = new Storage(ctx.storage);
@@ -50,7 +50,7 @@ export class ChatRoom extends DurableObject<Env> {
5050
}
5151
```
5252

53-
`@cloudflare/actors` library introduces the `Actor` class pattern. `Actor` lets you access Durable Objects without writing the Worker that communicates with your Durable Object (the Worker is created for you). By default, requests are routed to a Durable Object named "default".
53+
`@cloudflare/actors` library introduces the `Actor` class pattern. `Actor` lets you access Durable Objects without writing the Worker that communicates with your Durable Object (the Worker is created for you). By default, requests are routed to a Durable Object named "default".
5454

5555
```js
5656
export class MyActor extends Actor<Env> {

src/content/changelog/workers/2025-05-14-python-worker-durable-object.mdx

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

1212
You can now create [Durable Objects](/durable-objects/) using
1313
[Python Workers](/workers/languages/python/). A Durable Object is a special kind of
14-
Cloudflare Worker which uniquely combines compute with storage, enabling stateful
14+
Cloudflare Worker which uniquely combines compute with storage, enabling stateful
1515
long-running applications which run close to your users. For more info see
16-
[here](https://developers.cloudflare.com/durable-objects/what-are-durable-objects/).
16+
[here](/durable-objects/concepts/what-are-durable-objects/).
1717

1818
You can define a Durable Object in Python in a similar way to JavaScript:
1919

@@ -26,7 +26,7 @@ class MyDurableObject(DurableObject):
2626
def __init__(self, ctx, env):
2727
self.ctx = ctx
2828
self.env = env
29-
29+
3030
def on_fetch(self, request):
3131
result = self.ctx.storage.sql.exec("SELECT 'Hello, World!' as greeting").one()
3232
return Response(result.greeting)

src/content/docs/agents/platform/limits.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Many limits are inherited from those applied to Workers scripts and/or Durable O
2222

2323
---
2424

25-
[^1]: Yes, really. You can have tens of millions of Agents running concurrently, as each Agent is mapped to a [unique Durable Object](/durable-objects/what-are-durable-objects/) (actor).
25+
[^1]: Yes, really. You can have tens of millions of Agents running concurrently, as each Agent is mapped to a [unique Durable Object](/durable-objects/concepts/what-are-durable-objects/) (actor).
2626
[^2]: You can deploy up to [500 scripts per account](/workers/platform/limits/), but each script (project) can define multiple Agents. Each deployed script can be up to 10 MB on the [Workers Paid Plan](/workers/platform/pricing/#workers)
2727
[^3]: Compute (CPU) time per Agent is limited to 30 seconds, but this is refreshed when an Agent receives a new HTTP request, runs a [scheduled task](/agents/api-reference/schedule-tasks/), or an incoming WebSocket message.
2828

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: The Lifecycle of a Durable Object
3+
pcx_content_type: concept
4+
sidebar:
5+
order: 3
6+
7+
---
8+
9+
import { Render, TypeScriptExample } from "~/components";
10+
11+
This section describes the lifecycle of a [Durable Object](/durable-objects/concepts/what-are-durable-objects/).
12+
13+
To use a Durable Object you need to create a [Durable Object Stub](/durable-objects/api/stub/). In its simplest form, this looks like the following snippet:
14+
15+
```ts
16+
// Assume a DurableObjectNamespace binding MY_DURABLE_OBJECT
17+
// Every unique ID refers to an individual instance of the Durable Object class
18+
const id = env.MY_DURABLE_OBJECT.idFromName("foo");
19+
const stub = env.MY_DURABLE_OBJECT.get(id);
20+
```
21+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: Concepts
3+
pcx_content_type: navigation
4+
sidebar:
5+
order: 3
6+
group:
7+
hideIndex: true
8+
---
9+
10+
import { DirectoryListing } from "~/components";
11+
12+
<DirectoryListing />
File renamed without changes.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This guide will instruct you through:
1414
- Instantiating and communicating with a Durable Object from another Worker.
1515
- Deploying a Durable Object and a Worker that communicates with a Durable Object.
1616

17-
If you wish to learn more about Durable Objects, refer to [What are Durable Objects?](/durable-objects/what-are-durable-objects/).
17+
If you wish to learn more about Durable Objects, refer to [What are Durable Objects?](/durable-objects/concepts/what-are-durable-objects/).
1818

1919
## Quick start
2020

src/content/docs/durable-objects/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ SQLite-backed Durable Objects are now available on the Workers Free plan with th
3434

3535
<Render file="what-are-durable-objects"/>
3636

37-
For more information, refer to the full [What are Durable Objects?](/durable-objects/what-are-durable-objects/) page.
37+
For more information, refer to the full [What are Durable Objects?](/durable-objects/concepts/what-are-durable-objects/) page.
3838

3939
***
4040

0 commit comments

Comments
 (0)